[cairo-commit] goocanvas/src goocanvasatk.c, 1.5,
1.6 goocanvasgroupview.c, 1.14, 1.15 goocanvasimageview.c,
1.11, 1.12 goocanvasitemview.c, 1.10, 1.11 goocanvasitemview.h,
1.9, 1.10 goocanvasitemviewsimple.c, 1.6,
1.7 goocanvaspolylineview.c, 1.12, 1.13 goocanvastextview.c,
1.13, 1.14 goocanvasview.c, 1.23, 1.24
Damon Chaplin
commit at pdx.freedesktop.org
Wed Jul 19 08:49:49 PDT 2006
Committed by: damon
Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv10579/src
Modified Files:
goocanvasatk.c goocanvasgroupview.c goocanvasimageview.c
goocanvasitemview.c goocanvasitemview.h
goocanvasitemviewsimple.c goocanvaspolylineview.c
goocanvastextview.c goocanvasview.c
Log Message:
2006-07-19 Damon Chaplin <damon at gnome.org>
* src/goocanvasatk.c:
* src/goocanvasgroupview.c:
* src/goocanvasimageview.c:
* src/goocanvasitemview.c:
* src/goocanvasitemview.h:
* src/goocanvasitemviewsimple.c:
* src/goocanvaspolylineview.c:
* src/goocanvastextview.c:
* src/goocanvasview.c: changed item view update() and get_bounds()
methods to take a GooCanvasBounds* to fill in, rather than returning
a pointer to a static GooCanvasBounds. This makes it easier for
language bindings.
Index: goocanvasatk.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasatk.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- goocanvasatk.c 27 May 2006 19:31:44 -0000 1.5
+++ goocanvasatk.c 19 Jul 2006 15:49:47 -0000 1.6
@@ -38,7 +38,7 @@
GdkRectangle *rect)
{
GooCanvasView *canvas_view;
- GooCanvasBounds *bounds;
+ GooCanvasBounds bounds;
canvas_view = goo_canvas_item_view_get_canvas_view (view);
if (!canvas_view)
@@ -48,23 +48,23 @@
}
/* Get the bounds in device units. */
- bounds = goo_canvas_item_view_get_bounds (view);
+ goo_canvas_item_view_get_bounds (view, &bounds);
/* Convert to pixels within the entire canvas. */
- goo_canvas_view_convert_to_pixels (canvas_view, &bounds->x1, &bounds->y1);
- goo_canvas_view_convert_to_pixels (canvas_view, &bounds->x2, &bounds->y2);
+ goo_canvas_view_convert_to_pixels (canvas_view, &bounds.x1, &bounds.y1);
+ goo_canvas_view_convert_to_pixels (canvas_view, &bounds.x2, &bounds.y2);
/* Convert to pixels within the visible window. */
- bounds->x1 -= canvas_view->hadjustment->value;
- bounds->y1 -= canvas_view->vadjustment->value;
- bounds->x2 -= canvas_view->hadjustment->value;
- bounds->y2 -= canvas_view->vadjustment->value;
+ bounds.x1 -= canvas_view->hadjustment->value;
+ bounds.y1 -= canvas_view->vadjustment->value;
+ bounds.x2 -= canvas_view->hadjustment->value;
+ bounds.y2 -= canvas_view->vadjustment->value;
/* Round up or down to integers. */
- rect->x = floor (bounds->x1);
- rect->y = floor (bounds->y1);
- rect->width = ceil (bounds->x1) - rect->x;
- rect->height = ceil (bounds->y1) - rect->y;
+ rect->x = floor (bounds.x1);
+ rect->y = floor (bounds.y1);
+ rect->width = ceil (bounds.x1) - rect->x;
+ rect->height = ceil (bounds.y1) - rect->y;
}
Index: goocanvasgroupview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasgroupview.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- goocanvasgroupview.c 27 May 2006 19:31:44 -0000 1.14
+++ goocanvasgroupview.c 19 Jul 2006 15:49:47 -0000 1.15
@@ -262,12 +262,12 @@
GooCanvasGroupView *group_view)
{
GooCanvasItemView *view;
- GooCanvasBounds *bounds;
+ GooCanvasBounds bounds;
/* Request a redraw of the item's bounds. */
view = group_view->item_views->pdata[old_position];
- bounds = goo_canvas_item_view_get_bounds (view);
- goo_canvas_view_request_redraw (group_view->canvas_view, bounds);
+ goo_canvas_item_view_get_bounds (view, &bounds);
+ goo_canvas_view_request_redraw (group_view->canvas_view, &bounds);
goo_canvas_util_ptr_array_move (group_view->item_views, old_position,
new_position);
@@ -282,13 +282,13 @@
GooCanvasGroupView *group_view)
{
GooCanvasItemView *view;
- GooCanvasBounds *bounds;
+ GooCanvasBounds bounds;
view = group_view->item_views->pdata[item_num];
/* Request a redraw of the item's bounds. */
- bounds = goo_canvas_item_view_get_bounds (view);
- goo_canvas_view_request_redraw (group_view->canvas_view, bounds);
+ goo_canvas_item_view_get_bounds (view, &bounds);
+ goo_canvas_view_request_redraw (group_view->canvas_view, &bounds);
/* Reset the item's parent to NULL, in case it is kept around. */
goo_canvas_item_view_set_parent_view (view, NULL);
@@ -368,13 +368,14 @@
}
-static GooCanvasBounds*
+static void
goo_canvas_group_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
- GooCanvasBounds *bounds = &group_view->bounds, *child_bounds;
+ GooCanvasBounds child_bounds;
gint i;
if (entire_tree || (group_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
@@ -393,28 +394,28 @@
{
GooCanvasItemView *child_view = group_view->item_views->pdata[i];
- child_bounds = goo_canvas_item_view_update (child_view, entire_tree,
- cr);
+ goo_canvas_item_view_update (child_view, entire_tree, cr,
+ &child_bounds);
if (i == 0)
{
- bounds->x1 = child_bounds->x1;
- bounds->y1 = child_bounds->y1;
- bounds->x2 = child_bounds->x2;
- bounds->y2 = child_bounds->y2;
+ bounds->x1 = child_bounds.x1;
+ bounds->y1 = child_bounds.y1;
+ bounds->x2 = child_bounds.x2;
+ bounds->y2 = child_bounds.y2;
}
else
{
- bounds->x1 = MIN (bounds->x1, child_bounds->x1);
- bounds->y1 = MIN (bounds->y1, child_bounds->y1);
- bounds->x2 = MAX (bounds->x2, child_bounds->x2);
- bounds->y2 = MAX (bounds->y2, child_bounds->y2);
+ bounds->x1 = MIN (bounds->x1, child_bounds.x1);
+ bounds->y1 = MIN (bounds->y1, child_bounds.y1);
+ bounds->x2 = MAX (bounds->x2, child_bounds.x2);
+ bounds->y2 = MAX (bounds->y2, child_bounds.y2);
}
}
cairo_restore (cr);
- }
- return &group_view->bounds;
+ group_view->bounds = *bounds;
+ }
}
@@ -447,15 +448,16 @@
}
-static GooCanvasBounds*
-goo_canvas_group_view_get_bounds (GooCanvasItemView *view)
+static void
+goo_canvas_group_view_get_bounds (GooCanvasItemView *view,
+ GooCanvasBounds *bounds)
{
GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
if (group_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE)
goo_canvas_item_view_ensure_updated (view);
- return &group_view->bounds;
+ *bounds = group_view->bounds;
}
@@ -469,7 +471,7 @@
{
GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
GooCanvasGroup *group = group_view->group;
- GooCanvasBounds *child_bounds;
+ GooCanvasBounds child_bounds;
GooCanvasItemView *found_item = NULL;
gboolean visible = parent_visible;
int i;
@@ -498,11 +500,11 @@
for (i = group_view->item_views->len - 1; i >= 0; i--)
{
GooCanvasItemView *child_view = group_view->item_views->pdata[i];
- child_bounds = goo_canvas_item_view_get_bounds (child_view);
+ goo_canvas_item_view_get_bounds (child_view, &child_bounds);
/* Skip the item if the bounds don't contain the point. */
- if (child_bounds->x1 > x || child_bounds->x2 < x
- || child_bounds->y1 > y || child_bounds->y2 < y)
+ if (child_bounds.x1 > x || child_bounds.x2 < x
+ || child_bounds.y1 > y || child_bounds.y2 < y)
continue;
found_item = goo_canvas_item_view_get_item_at (child_view, x, y, cr,
@@ -543,7 +545,7 @@
{
GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
GooCanvasGroup *group = group_view->group;
- GooCanvasBounds *child_bounds;
+ GooCanvasBounds child_bounds;
gint i;
/* Check if the item should be visible. */
@@ -559,11 +561,11 @@
{
GooCanvasItemView *child_view = group_view->item_views->pdata[i];
- child_bounds = goo_canvas_item_view_get_bounds (child_view);
+ goo_canvas_item_view_get_bounds (child_view, &child_bounds);
/* Skip the item if the bounds don't intersect the expose rectangle. */
- if (child_bounds->x1 > bounds->x2 || child_bounds->x2 < bounds->x1
- || child_bounds->y1 > bounds->y2 || child_bounds->y2 < bounds->y1)
+ if (child_bounds.x1 > bounds->x2 || child_bounds.x2 < bounds->x1
+ || child_bounds.y1 > bounds->y2 || child_bounds.y2 < bounds->y1)
continue;
goo_canvas_item_view_paint (child_view, cr, bounds, scale);
Index: goocanvasimageview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimageview.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- goocanvasimageview.c 27 May 2006 19:31:44 -0000 1.11
+++ goocanvasimageview.c 19 Jul 2006 15:49:47 -0000 1.12
@@ -135,16 +135,16 @@
}
-static GooCanvasBounds*
+static void
goo_canvas_image_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
GooCanvasItemSimple *simple = simple_view->item;
GooCanvasImage *image = (GooCanvasImage*) simple;
GooCanvasView *canvas_view;
- GooCanvasBounds *bounds = &simple_view->bounds;
if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
{
@@ -157,13 +157,13 @@
canvas_view = goo_canvas_item_view_get_canvas_view (simple_view->parent_view);
/* Request a redraw of the existing bounds. */
- goo_canvas_view_request_redraw (canvas_view, bounds);
+ goo_canvas_view_request_redraw (canvas_view, &simple_view->bounds);
/* Compute the new bounds. */
- simple_view->bounds.x1 = image->x;
- simple_view->bounds.y1 = image->y;
- simple_view->bounds.x2 = image->x + image->width;
- simple_view->bounds.y2 = image->y + image->height;
+ bounds->x1 = image->x;
+ bounds->y1 = image->y;
+ bounds->x2 = image->x + image->width;
+ bounds->y2 = image->y + image->height;
goo_canvas_item_simple_user_bounds_to_device (simple, cr, bounds);
@@ -171,9 +171,9 @@
goo_canvas_view_request_redraw (canvas_view, bounds);
cairo_restore (cr);
- }
- return bounds;
+ simple_view->bounds = *bounds;
+ }
}
Index: goocanvasitemview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemview.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- goocanvasitemview.c 19 Jul 2006 13:52:33 -0000 1.10
+++ goocanvasitemview.c 19 Jul 2006 15:49:47 -0000 1.11
@@ -525,17 +525,17 @@
/**
* goo_canvas_item_view_get_bounds:
* @view: a #GooCanvasItemView.
+ * @bounds: a #GooCanvasBounds to return the bounds in.
*
* Gets the bounds of the item.
- *
- * Returns: the bounds of the item.
**/
-GooCanvasBounds*
-goo_canvas_item_view_get_bounds (GooCanvasItemView *view)
+void
+goo_canvas_item_view_get_bounds (GooCanvasItemView *view,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewIface *iface = GOO_CANVAS_ITEM_VIEW_GET_IFACE (view);
- return iface->get_bounds (view);
+ iface->get_bounds (view, bounds);
}
@@ -617,19 +617,19 @@
* @view: a #GooCanvasItemView.
* @entire_tree: if the entire subtree should be updated.
* @cr: a cairo context.
+ * @bounds: a #GooCanvasBounds to return the new bounds in.
*
* Updates the item view, if needed, and any children.
- *
- * Returns: the new bounds of the item view.
**/
-GooCanvasBounds*
+void
goo_canvas_item_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewIface *iface = GOO_CANVAS_ITEM_VIEW_GET_IFACE (view);
- return iface->update (view, entire_tree, cr);
+ iface->update (view, entire_tree, cr, bounds);
}
Index: goocanvasitemview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemview.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasitemview.h 24 Apr 2006 13:53:42 -0000 1.9
+++ goocanvasitemview.h 19 Jul 2006 15:49:47 -0000 1.10
@@ -57,7 +57,8 @@
void (* set_parent_view) (GooCanvasItemView *view,
GooCanvasItemView *parent_view);
GooCanvasItem* (* get_item) (GooCanvasItemView *view);
- GooCanvasBounds* (* get_bounds) (GooCanvasItemView *view);
+ void (* get_bounds) (GooCanvasItemView *view,
+ GooCanvasBounds *bounds);
GooCanvasItemView* (* get_item_at) (GooCanvasItemView *view,
gdouble x,
gdouble y,
@@ -65,9 +66,10 @@
gboolean is_pointer_event,
gboolean parent_is_visible);
gboolean (* is_visible) (GooCanvasItemView *view);
- GooCanvasBounds* (* update) (GooCanvasItemView *view,
+ void (* update) (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr);
+ cairo_t *cr,
+ GooCanvasBounds *bounds);
void (* paint) (GooCanvasItemView *view,
cairo_t *cr,
GooCanvasBounds *bounds,
@@ -130,7 +132,8 @@
gboolean goo_canvas_item_view_is_container (GooCanvasItemView *view);
GooCanvasItem* goo_canvas_item_view_get_item (GooCanvasItemView *view);
-GooCanvasBounds* goo_canvas_item_view_get_bounds (GooCanvasItemView *view);
+void goo_canvas_item_view_get_bounds (GooCanvasItemView *view,
+ GooCanvasBounds *bounds);
GooCanvasItemView* goo_canvas_item_view_get_item_at (GooCanvasItemView *view,
gdouble x,
gdouble y,
@@ -140,9 +143,10 @@
gboolean goo_canvas_item_view_is_visible (GooCanvasItemView *view);
void goo_canvas_item_view_request_update (GooCanvasItemView *view);
void goo_canvas_item_view_ensure_updated (GooCanvasItemView *view);
-GooCanvasBounds* goo_canvas_item_view_update (GooCanvasItemView *view,
+void goo_canvas_item_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr);
+ cairo_t *cr,
+ GooCanvasBounds *bounds);
void goo_canvas_item_view_paint (GooCanvasItemView *view,
cairo_t *cr,
GooCanvasBounds *bounds,
Index: goocanvasitemviewsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemviewsimple.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- goocanvasitemviewsimple.c 27 May 2006 19:31:44 -0000 1.6
+++ goocanvasitemviewsimple.c 19 Jul 2006 15:49:47 -0000 1.7
@@ -160,15 +160,16 @@
}
-static GooCanvasBounds*
-goo_canvas_item_view_simple_get_bounds (GooCanvasItemView *view)
+static void
+goo_canvas_item_view_simple_get_bounds (GooCanvasItemView *view,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
if (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE)
goo_canvas_item_view_ensure_updated (view);
- return &simple_view->bounds;
+ *bounds = simple_view->bounds;
}
@@ -241,15 +242,15 @@
}
-static GooCanvasBounds*
+static void
goo_canvas_item_view_simple_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
GooCanvasItemSimple *simple = simple_view->item;
GooCanvasView *canvas_view;
- GooCanvasBounds *bounds = &simple_view->bounds;
if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
{
@@ -262,7 +263,7 @@
canvas_view = goo_canvas_item_view_get_canvas_view (simple_view->parent_view);
/* Request a redraw of the existing bounds. */
- goo_canvas_view_request_redraw (canvas_view, bounds);
+ goo_canvas_view_request_redraw (canvas_view, &simple_view->bounds);
/* Use the virtual method subclasses define to create the path. */
GOO_CANVAS_ITEM_VIEW_SIMPLE_GET_CLASS (view)->create_path (simple, cr);
@@ -274,9 +275,9 @@
goo_canvas_view_request_redraw (canvas_view, bounds);
cairo_restore (cr);
- }
- return bounds;
+ simple_view->bounds = *bounds;
+ }
}
Index: goocanvaspolylineview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspolylineview.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- goocanvaspolylineview.c 27 May 2006 19:31:44 -0000 1.12
+++ goocanvaspolylineview.c 19 Jul 2006 15:49:47 -0000 1.13
@@ -300,17 +300,17 @@
}
-static GooCanvasBounds*
+static void
goo_canvas_polyline_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
GooCanvasPolylineView *polyline_view = (GooCanvasPolylineView*) view;
GooCanvasItemSimple *simple = simple_view->item;
GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple;
GooCanvasView *canvas_view;
- GooCanvasBounds *bounds = &simple_view->bounds;
if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
{
@@ -326,7 +326,7 @@
canvas_view = goo_canvas_item_view_get_canvas_view (simple_view->parent_view);
/* Request a redraw of the existing bounds. */
- goo_canvas_view_request_redraw (canvas_view, bounds);
+ goo_canvas_view_request_redraw (canvas_view, &simple_view->bounds);
/* Compute the new bounds. */
goo_canvas_polyline_view_compute_bounds (polyline_view, polyline, cr,
@@ -336,9 +336,9 @@
goo_canvas_view_request_redraw (canvas_view, bounds);
cairo_restore (cr);
- }
- return bounds;
+ simple_view->bounds = *bounds;
+ }
}
Index: goocanvastextview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastextview.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- goocanvastextview.c 27 May 2006 19:31:44 -0000 1.13
+++ goocanvastextview.c 19 Jul 2006 15:49:47 -0000 1.14
@@ -180,16 +180,16 @@
}
-static GooCanvasBounds*
+static void
goo_canvas_text_view_update (GooCanvasItemView *view,
gboolean entire_tree,
- cairo_t *cr)
+ cairo_t *cr,
+ GooCanvasBounds *bounds)
{
GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
GooCanvasTextView *text_view = (GooCanvasTextView*) view;
GooCanvasItemSimple *simple = simple_view->item;
GooCanvasText *text = (GooCanvasText*) simple;
- GooCanvasBounds *bounds = &simple_view->bounds;
GooCanvasView *canvas_view;
PangoLayout *layout;
@@ -204,7 +204,7 @@
canvas_view = goo_canvas_item_view_get_canvas_view (simple_view->parent_view);
/* Request a redraw of the existing bounds. */
- goo_canvas_view_request_redraw (canvas_view, bounds);
+ goo_canvas_view_request_redraw (canvas_view, &simple_view->bounds);
/* Compute the new bounds. */
layout = goo_canvas_text_view_create_layout (text_view, text, cr, bounds);
@@ -216,9 +216,9 @@
goo_canvas_view_request_redraw (canvas_view, bounds);
cairo_restore (cr);
- }
- return bounds;
+ simple_view->bounds = *bounds;
+ }
}
Index: goocanvasview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasview.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- goocanvasview.c 19 Jul 2006 13:52:33 -0000 1.23
+++ goocanvasview.c 19 Jul 2006 15:49:47 -0000 1.24
@@ -1130,13 +1130,13 @@
goo_canvas_view_scroll_to_item_view (GooCanvasView *view,
GooCanvasItemView *item_view)
{
- GooCanvasBounds *bounds;
+ GooCanvasBounds bounds;
gdouble hvalue, vvalue;
- bounds = goo_canvas_item_view_get_bounds (item_view);
+ goo_canvas_item_view_get_bounds (item_view, &bounds);
- goo_canvas_view_convert_to_pixels (view, &bounds->x1, &bounds->y1);
- goo_canvas_view_convert_to_pixels (view, &bounds->x2, &bounds->y2);
+ goo_canvas_view_convert_to_pixels (view, &bounds.x1, &bounds.y1);
+ goo_canvas_view_convert_to_pixels (view, &bounds.x2, &bounds.y2);
view->freeze_count++;
@@ -1145,8 +1145,8 @@
vvalue = view->vadjustment->value;
/* Update the adjustments so the item view is displayed. */
- gtk_adjustment_clamp_page (view->hadjustment, bounds->x1, bounds->x2);
- gtk_adjustment_clamp_page (view->vadjustment, bounds->y1, bounds->y2);
+ gtk_adjustment_clamp_page (view->hadjustment, bounds.x1, bounds.x2);
+ gtk_adjustment_clamp_page (view->vadjustment, bounds.y1, bounds.y2);
view->freeze_count--;
@@ -1273,6 +1273,8 @@
goo_canvas_view_update_internal (GooCanvasView *view,
cairo_t *cr)
{
+ GooCanvasBounds bounds;
+
/* It is possible that processing the first set of updates causes other
updates to be scheduled, so we loop round until all are done. Items
should ensure that they don't cause this to loop forever. */
@@ -1280,7 +1282,7 @@
{
view->need_update = FALSE;
if (view->root_view)
- goo_canvas_item_view_update (view->root_view, FALSE, cr);
+ goo_canvas_item_view_update (view->root_view, FALSE, cr, &bounds);
}
/* Check which item view is under the pointer. */
@@ -2368,7 +2370,7 @@
gdouble best_x_offset, best_y_offset, best_score;
/* The offsets for the item being tested. */
- GooCanvasBounds *current_bounds;
+ GooCanvasBounds current_bounds;
gdouble current_x_offset, current_y_offset, current_score;
};
@@ -2387,8 +2389,8 @@
/* If an item view is currently focused, we just need its bounds. */
if (data->focused_item_view)
{
- bounds = goo_canvas_item_view_get_bounds (data->focused_item_view);
- data->focused_bounds = *bounds;
+ goo_canvas_item_view_get_bounds (data->focused_item_view,
+ &data->focused_bounds);
return;
}
@@ -2483,9 +2485,9 @@
data->current_score = 0.0;
- data->current_bounds = goo_canvas_item_view_get_bounds (item_view);
- center_x = (data->current_bounds->x1 + data->current_bounds->x2) / 2.0;
- center_y = (data->current_bounds->y1 + data->current_bounds->y2) / 2.0;
+ goo_canvas_item_view_get_bounds (item_view, &data->current_bounds);
+ center_x = (data->current_bounds.x1 + data->current_bounds.x2) / 2.0;
+ center_y = (data->current_bounds.y1 + data->current_bounds.y2) / 2.0;
/* Calculate the offsets of the center of this item view from the center
of the current focus item view or widget. */
@@ -2663,25 +2665,25 @@
case GTK_DIR_UP:
/* If the group is below the bottom of the current focused item
view we can skip it. */
- if (data->current_bounds->y1 > data->focused_bounds.y2)
+ if (data->current_bounds.y1 > data->focused_bounds.y2)
return;
break;
case GTK_DIR_DOWN:
/* If the group is above the top of the current focused item
view we can skip it. */
- if (data->current_bounds->y2 < data->focused_bounds.y1)
+ if (data->current_bounds.y2 < data->focused_bounds.y1)
return;
break;
case GTK_DIR_LEFT:
/* If the group is to the right of the current focused item
view we can skip it. */
- if (data->current_bounds->x1 > data->focused_bounds.x2)
+ if (data->current_bounds.x1 > data->focused_bounds.x2)
return;
break;
case GTK_DIR_RIGHT:
/* If the group is to the left of the current focused item
view we can skip it. */
- if (data->current_bounds->x2 < data->focused_bounds.x1)
+ if (data->current_bounds.x2 < data->focused_bounds.x1)
return;
break;
default:
More information about the cairo-commit
mailing list