[cairo-commit] goocanvas/src goocanvasgroup.h, 1.7, 1.8 goocanvasgroupview.c, 1.17, 1.18 goocanvasimageview.c, 1.14, 1.15 goocanvasitemviewsimple.c, 1.9, 1.10 goocanvasmodelsimple.c, 1.4, 1.5 goocanvaspolylineview.c, 1.15, 1.16 goocanvastextview.c, 1.16, 1.17

Damon Chaplin commit at pdx.freedesktop.org
Tue Aug 8 14:58:16 PDT 2006


Committed by: damon

Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv29561/src

Modified Files:
	goocanvasgroup.h goocanvasgroupview.c goocanvasimageview.c 
	goocanvasitemviewsimple.c goocanvasmodelsimple.c 
	goocanvaspolylineview.c goocanvastextview.c 
Log Message:
2006-08-08  Damon Chaplin  <damon at gnome.org>

	* src/goocanvastextview.c (goo_canvas_text_view_update): 
	* src/goocanvaspolylineview.c (goo_canvas_polyline_view_update): 
	* src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_update): 
	* src/goocanvasimageview.c (goo_canvas_image_view_update): 
	* src/goocanvasgroupview.c (goo_canvas_group_view_update): rewrote the
	update methods to make sure the bounds is always set and returned
	correctly.



Index: goocanvasgroup.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasgroup.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- goocanvasgroup.h	26 Jul 2006 15:45:43 -0000	1.7
+++ goocanvasgroup.h	8 Aug 2006 21:58:13 -0000	1.8
@@ -47,19 +47,19 @@
   /* The transformation matrix, or NULL. */
   cairo_matrix_t transform;
 
-  /* Whether the item is visible, invisible, or visible above a given scale. */
-  GooCanvasItemVisibility visibility;
-
   /* If visibility is VISIBLE_ABOVE_THRESHOLD the item is visible if the canvas
      scale setting is above this threshold (or equal to it). */
   gdouble visibility_threshold;
 
-  /* What events the group should receive. */
-  GooCanvasPointerEvents pointer_events;
-
   /* The title and description of the item for accessibility. */
   gchar *title;
   gchar *description;
+
+  /* Whether the item is visible, invisible, or visible above a given scale. */
+  GooCanvasItemVisibility visibility	: 2;
+
+  /* What events the group should receive. */
+  GooCanvasPointerEvents pointer_events : 4;
 };
 
 struct _GooCanvasGroupClass

Index: goocanvasgroupview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasgroupview.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- goocanvasgroupview.c	26 Jul 2006 15:08:19 -0000	1.17
+++ goocanvasgroupview.c	8 Aug 2006 21:58:13 -0000	1.18
@@ -436,7 +436,8 @@
       group_view->flags &= ~GOO_CANVAS_ITEM_VIEW_NEED_UPDATE;
       group_view->flags &= ~GOO_CANVAS_ITEM_VIEW_NEED_ENTIRE_SUBTREE_UPDATE;
 
-      bounds->x1 = bounds->y1 = bounds->x2 = bounds->y2 = 0.0;
+      group_view->bounds.x1 = group_view->bounds.y1 = 0.0;
+      group_view->bounds.x2 = group_view->bounds.y2 = 0.0;
 
       cairo_save (cr);
 
@@ -452,23 +453,27 @@
 	  
 	  if (i == 0)
 	    {
-	      bounds->x1 = child_bounds.x1;
-	      bounds->y1 = child_bounds.y1;
-	      bounds->x2 = child_bounds.x2;
-	      bounds->y2 = child_bounds.y2;
+	      group_view->bounds.x1 = child_bounds.x1;
+	      group_view->bounds.y1 = child_bounds.y1;
+	      group_view->bounds.x2 = child_bounds.x2;
+	      group_view->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);
+	      group_view->bounds.x1 = MIN (group_view->bounds.x1,
+					   child_bounds.x1);
+	      group_view->bounds.y1 = MIN (group_view->bounds.y1,
+					   child_bounds.y1);
+	      group_view->bounds.x2 = MAX (group_view->bounds.x2,
+					   child_bounds.x2);
+	      group_view->bounds.y2 = MAX (group_view->bounds.y2,
+					   child_bounds.y2);
 	    }
 	}
       cairo_restore (cr);
-
-      group_view->bounds = *bounds;
     }
+
+  *bounds = group_view->bounds;
 }
 
 

Index: goocanvasimageview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimageview.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- goocanvasimageview.c	26 Jul 2006 15:08:19 -0000	1.14
+++ goocanvasimageview.c	8 Aug 2006 21:58:13 -0000	1.15
@@ -147,7 +147,6 @@
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasItemSimple *simple = simple_view->item;
   GooCanvasImage *image = (GooCanvasImage*) simple;
-  GooCanvasView *canvas_view;
 
   if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
     {
@@ -159,26 +158,27 @@
       if (simple_view->transform)
 	cairo_transform (cr, simple_view->transform);
 
-      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, &simple_view->bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       /* Compute the new bounds. */
-      bounds->x1 = image->x;
-      bounds->y1 = image->y;
-      bounds->x2 = image->x + image->width;
-      bounds->y2 = image->y + image->height;
+      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;
 
-      goo_canvas_item_simple_user_bounds_to_device (simple, cr, bounds);
+      goo_canvas_item_simple_user_bounds_to_device (simple, cr,
+						    &simple_view->bounds);
 
       /* Request a redraw of the new bounds. */
-      goo_canvas_view_request_redraw (canvas_view, bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       cairo_restore (cr);
-
-      simple_view->bounds = *bounds;
     }
+
+  *bounds = simple_view->bounds;
 }
 
 

Index: goocanvasitemviewsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemviewsimple.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasitemviewsimple.c	26 Jul 2006 15:08:19 -0000	1.9
+++ goocanvasitemviewsimple.c	8 Aug 2006 21:58:13 -0000	1.10
@@ -324,15 +324,17 @@
       GOO_CANVAS_ITEM_VIEW_SIMPLE_GET_CLASS (view)->create_path (simple, cr);
 
       /* Compute the new bounds. */
-      goo_canvas_item_simple_get_path_bounds (simple, cr, bounds);
+      goo_canvas_item_simple_get_path_bounds (simple, cr,
+					      &simple_view->bounds);
 
       /* Request a redraw of the new bounds. */
-      goo_canvas_view_request_redraw (simple_view->canvas_view, bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       cairo_restore (cr);
-
-      simple_view->bounds = *bounds;
     }
+
+  *bounds = simple_view->bounds;
 }
 
 

Index: goocanvasmodelsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasmodelsimple.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvasmodelsimple.c	26 Jul 2006 15:45:43 -0000	1.4
+++ goocanvasmodelsimple.c	8 Aug 2006 21:58:13 -0000	1.5
@@ -77,7 +77,8 @@
 {
   model->root_group = goo_canvas_group_new (NULL);
 
-  goo_canvas_group_set_model (model->root_group, GOO_CANVAS_MODEL (model));
+  goo_canvas_group_set_model (GOO_CANVAS_GROUP (model->root_group),
+			      GOO_CANVAS_MODEL (model));
 }
 
 

Index: goocanvaspolylineview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspolylineview.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- goocanvaspolylineview.c	26 Jul 2006 15:08:19 -0000	1.15
+++ goocanvaspolylineview.c	8 Aug 2006 21:58:13 -0000	1.16
@@ -312,7 +312,6 @@
   GooCanvasPolylineView *polyline_view = (GooCanvasPolylineView*) view;
   GooCanvasItemSimple *simple = simple_view->item;
   GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple;
-  GooCanvasView *canvas_view;
 
   if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
     {
@@ -327,22 +326,22 @@
       if (simple_view->transform)
 	cairo_transform (cr, simple_view->transform);
 
-      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, &simple_view->bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       /* Compute the new bounds. */
       goo_canvas_polyline_view_compute_bounds (polyline_view, polyline, cr,
-					       bounds);
+					       &simple_view->bounds);
 
       /* Request a redraw of the new bounds. */
-      goo_canvas_view_request_redraw (canvas_view, bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       cairo_restore (cr);
-
-      simple_view->bounds = *bounds;
     }
+
+  *bounds = simple_view->bounds;
 }
 
 

Index: goocanvastextview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastextview.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- goocanvastextview.c	26 Jul 2006 15:08:19 -0000	1.16
+++ goocanvastextview.c	8 Aug 2006 21:58:13 -0000	1.17
@@ -190,7 +190,6 @@
   GooCanvasTextView *text_view = (GooCanvasTextView*) view;
   GooCanvasItemSimple *simple = simple_view->item;
   GooCanvasText *text = (GooCanvasText*) simple;
-  GooCanvasView *canvas_view;
   PangoLayout *layout;
 
   if (entire_tree || (simple_view->flags & GOO_CANVAS_ITEM_VIEW_NEED_UPDATE))
@@ -203,24 +202,26 @@
       if (simple_view->transform)
 	cairo_transform (cr, simple_view->transform);
 
-      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, &simple_view->bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       /* Compute the new bounds. */
-      layout = goo_canvas_text_view_create_layout (text_view, text, cr, bounds);
+      layout = goo_canvas_text_view_create_layout (text_view, text, cr,
+						   &simple_view->bounds);
       g_object_unref (layout);
 
-      goo_canvas_item_simple_user_bounds_to_device (simple, cr, bounds);
+      goo_canvas_item_simple_user_bounds_to_device (simple, cr,
+						    &simple_view->bounds);
 
       /* Request a redraw of the new bounds. */
-      goo_canvas_view_request_redraw (canvas_view, bounds);
+      goo_canvas_view_request_redraw (simple_view->canvas_view,
+				      &simple_view->bounds);
 
       cairo_restore (cr);
-
-      simple_view->bounds = *bounds;
     }
+
+  *bounds = simple_view->bounds;
 }
 
 



More information about the cairo-commit mailing list