- cairo_move_to (cr, base,
- CLAMP (y - priv->win_y - TAIL_GAP_WIDTH / 2,
- 0, allocation->height - TAIL_GAP_WIDTH));
- cairo_line_to (cr, tip, CLAMP (y - priv->win_y, 0, allocation->height));
- cairo_line_to (cr, base,
- CLAMP (y - priv->win_y + TAIL_GAP_WIDTH / 2,
- TAIL_GAP_WIDTH, allocation->height));
+ initial_x = base;
+ initial_y = CLAMP (y - priv->win_y - TAIL_GAP_WIDTH / 2,
+ 0, allocation.height - TAIL_GAP_WIDTH);
+
+ tip_x = tip;
+ tip_y = CLAMP (y - priv->win_y, 0, allocation.height);
+
+ final_x = base;
+ final_y = CLAMP (y - priv->win_y + TAIL_GAP_WIDTH / 2,
+ TAIL_GAP_WIDTH, allocation.height);
+ }
+
+ if (initial_x_out)
+ *initial_x_out = initial_x;
+ if (initial_y_out)
+ *initial_y_out = initial_y;
+
+ if (tip_x_out)
+ *tip_x_out = tip_x;
+ if (tip_y_out)
+ *tip_y_out = tip_y;
+
+ if (final_x_out)
+ *final_x_out = final_x;
+ if (final_y_out)
+ *final_y_out = final_y;
+
+ if (gap_side_out)
+ *gap_side_out = gap_side;
+}
+
+static void
+gtk_bubble_window_get_rect_coords (GtkBubbleWindow *window,
+ gint *x1_out,
+ gint *y1_out,
+ gint *x2_out,
+ gint *y2_out)
+{
+ GtkBubbleWindowPrivate *priv = window->priv;
+ gint x1, x2, y1, y2;
+ GtkAllocation allocation;
+
+ x1 = y1 = x2 = y2 = 0;
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+
+ if (priv->final_position == GTK_POS_TOP)
+ {
+ x1 = 0;
+ y1 = 0;
+ x2 = allocation.width;
+ y2 = allocation.height - TAIL_HEIGHT;
+ }
+ else if (priv->final_position == GTK_POS_BOTTOM)
+ {
+ x1 = 0;
+ y1 = TAIL_HEIGHT;
+ x2 = allocation.width;
+ y2 = allocation.height;
+ }
+ else if (priv->final_position == GTK_POS_LEFT)
+ {
+ x1 = 0;
+ y1 = 0;
+ x2 = allocation.width - TAIL_HEIGHT;
+ y2 = allocation.height;
+ }
+ else if (priv->final_position == GTK_POS_RIGHT)
+ {
+ x1 = TAIL_HEIGHT;
+ y1 = 0;
+ x2 = allocation.width;
+ y2 = allocation.height;