[cairo-commit] goocanvas/src goocanvasatk.c, 1.2, 1.3 goocanvasellipse.c, 1.3, 1.4 goocanvasellipseview.c, 1.9, 1.10 goocanvasellipseview.h, 1.3, 1.4 goocanvasgroupview.c, 1.12, 1.13 goocanvasimage.c, 1.4, 1.5 goocanvasimageview.c, 1.9, 1.10 goocanvasimageview.h, 1.3, 1.4 goocanvasitemview.c, 1.8, 1.9 goocanvasitemview.h, 1.8, 1.9 goocanvasitemviewsimple.c, 1.4, 1.5 goocanvasitemviewsimple.h, 1.3, 1.4 goocanvaspath.c, 1.3, 1.4 goocanvaspathview.c, 1.7, 1.8 goocanvaspathview.h, 1.3, 1.4 goocanvaspolyline.c, 1.3, 1.4 goocanvaspolylineview.c, 1.10, 1.11 goocanvaspolylineview.h, 1.4, 1.5 goocanvasrect.c, 1.3, 1.4 goocanvasrectview.c, 1.9, 1.10 goocanvasrectview.h, 1.3, 1.4 goocanvastext.c, 1.3, 1.4 goocanvastextview.c, 1.10, 1.11 goocanvastextview.h, 1.4, 1.5 goocanvasview.c, 1.19, 1.20

Damon Chaplin commit at pdx.freedesktop.org
Mon Apr 24 06:53:44 PDT 2006


Committed by: damon

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

Modified Files:
	goocanvasatk.c goocanvasellipse.c goocanvasellipseview.c 
	goocanvasellipseview.h goocanvasgroupview.c goocanvasimage.c 
	goocanvasimageview.c goocanvasimageview.h goocanvasitemview.c 
	goocanvasitemview.h goocanvasitemviewsimple.c 
	goocanvasitemviewsimple.h goocanvaspath.c goocanvaspathview.c 
	goocanvaspathview.h goocanvaspolyline.c 
	goocanvaspolylineview.c goocanvaspolylineview.h 
	goocanvasrect.c goocanvasrectview.c goocanvasrectview.h 
	goocanvastext.c goocanvastextview.c goocanvastextview.h 
	goocanvasview.c 
Log Message:
2006-04-24  Damon Chaplin  <damon at gnome.org>

	* src/goocanvasitemview.c (goo_canvas_item_view_is_visible) 
	(goo_canvas_item_view_get_item_at): removed scale argument. We get it
	from the canvas view now, to make the API a little simpler.

	* src/goocanvasitemviewsimple.h (struct _GooCanvasItemViewSimple): 
	added pointer to the canvas view.

	* src/*view.[hc]: added canvas view argument to all view creation
	functions.



Index: goocanvasatk.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasatk.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- goocanvasatk.c	18 Apr 2006 23:40:44 -0000	1.2
+++ goocanvasatk.c	24 Apr 2006 13:53:42 -0000	1.3
@@ -394,7 +394,7 @@
   if (!canvas_view)
     return state_set;
 
-  if (goo_canvas_item_view_is_visible (item_view, canvas_view->scale))
+  if (goo_canvas_item_view_is_visible (item_view))
     {
       atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
 

Index: goocanvasellipse.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasellipse.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasellipse.c	16 Apr 2006 10:39:51 -0000	1.3
+++ goocanvasellipse.c	24 Apr 2006 13:53:42 -0000	1.4
@@ -240,7 +240,8 @@
 				GooCanvasView     *canvas_view,
 				GooCanvasItemView *parent_view)
 {
-  return goo_canvas_ellipse_view_new (parent_view, (GooCanvasEllipse*) item);
+  return goo_canvas_ellipse_view_new (canvas_view, parent_view,
+				      (GooCanvasEllipse*) item);
 }
 
 

Index: goocanvasellipseview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasellipseview.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasellipseview.c	18 Apr 2006 23:40:44 -0000	1.9
+++ goocanvasellipseview.c	24 Apr 2006 13:53:42 -0000	1.10
@@ -58,6 +58,7 @@
 
 /**
  * goo_canvas_ellipse_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @ellipse: the ellipse item.
  * 
@@ -69,12 +70,14 @@
  * Returns: a new #GooCanvasEllipseView.
  **/
 GooCanvasItemView*
-goo_canvas_ellipse_view_new      (GooCanvasItemView *parent_view,
+goo_canvas_ellipse_view_new      (GooCanvasView     *canvas_view,
+				  GooCanvasItemView *parent_view,
 				  GooCanvasEllipse  *ellipse)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_ELLIPSE_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (ellipse);
 

Index: goocanvasellipseview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasellipseview.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasellipseview.h	16 Apr 2006 13:20:05 -0000	1.3
+++ goocanvasellipseview.h	24 Apr 2006 13:53:42 -0000	1.4
@@ -42,7 +42,8 @@
 
 
 GType              goo_canvas_ellipse_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_ellipse_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_ellipse_view_new      (GooCanvasView     *canvas_view,
+						     GooCanvasItemView *parent_view,
 						     GooCanvasEllipse  *ellipse);
 
 

Index: goocanvasgroupview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasgroupview.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- goocanvasgroupview.c	18 Apr 2006 23:40:44 -0000	1.12
+++ goocanvasgroupview.c	24 Apr 2006 13:53:42 -0000	1.13
@@ -465,8 +465,7 @@
 				   gdouble             y,
 				   cairo_t            *cr,
 				   gboolean            is_pointer_event,
-				   gboolean            parent_visible,
-				   gdouble             scale)
+				   gboolean            parent_visible)
 {
   GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
   GooCanvasGroup *group = group_view->group;
@@ -480,7 +479,7 @@
 
   if (group->visibility == GOO_CANVAS_ITEM_INVISIBLE
       || (group->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-	  && scale < group->visibility_threshold))
+	  && group_view->canvas_view->scale < group->visibility_threshold))
     visible = FALSE;
 
   /* Check if the group should receive events. */
@@ -508,7 +507,7 @@
 
       found_item = goo_canvas_item_view_get_item_at (child_view, x, y, cr,
 						     is_pointer_event,
-						     visible, scale);
+						     visible);
       if (found_item)
 	break;
     }
@@ -519,19 +518,18 @@
 
 
 static gboolean
-goo_canvas_group_view_is_visible  (GooCanvasItemView   *view,
-				   gdouble              scale)
+goo_canvas_group_view_is_visible  (GooCanvasItemView   *view)
 {
   GooCanvasGroupView *group_view = (GooCanvasGroupView*) view;
   GooCanvasGroup *group = group_view->group;
 
   if (group->visibility == GOO_CANVAS_ITEM_INVISIBLE
       || (group->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-	  && scale < group->visibility_threshold))
+	  && group_view->canvas_view->scale < group->visibility_threshold))
     return FALSE;
 
   if (group_view->parent_view)
-    return goo_canvas_item_view_is_visible (group_view->parent_view, scale);
+    return goo_canvas_item_view_is_visible (group_view->parent_view);
 
   return TRUE;
 }

Index: goocanvasimage.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvasimage.c	16 Apr 2006 10:39:51 -0000	1.4
+++ goocanvasimage.c	24 Apr 2006 13:53:42 -0000	1.5
@@ -211,7 +211,8 @@
 			      GooCanvasView     *canvas_view,
 			      GooCanvasItemView *parent_view)
 {
-  return goo_canvas_image_view_new (parent_view, (GooCanvasImage*) item);
+  return goo_canvas_image_view_new (canvas_view, parent_view,
+				    (GooCanvasImage*) item);
 }
 
 

Index: goocanvasimageview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimageview.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasimageview.c	18 Apr 2006 23:40:44 -0000	1.9
+++ goocanvasimageview.c	24 Apr 2006 13:53:42 -0000	1.10
@@ -55,6 +55,7 @@
 
 /**
  * goo_canvas_image_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @image: the image item.
  * 
@@ -66,12 +67,14 @@
  * Returns: a new #GooCanvasImageView.
  **/
 GooCanvasItemView*
-goo_canvas_image_view_new (GooCanvasItemView *parent_view,
+goo_canvas_image_view_new (GooCanvasView     *canvas_view,
+			   GooCanvasItemView *parent_view,
 			   GooCanvasImage    *image)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_IMAGE_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (image);
 
@@ -91,8 +94,7 @@
 				   gdouble             y,
 				   cairo_t            *cr,
 				   gboolean            is_pointer_event,
-				   gboolean            parent_visible,
-				   gdouble             scale)
+				   gboolean            parent_visible)
 {
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasItemSimple *simple = simple_view->item;
@@ -113,7 +115,7 @@
 	  && (!parent_visible
 	      || simple->visibility == GOO_CANVAS_ITEM_INVISIBLE
 	      || (simple->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-		  && scale < simple->visibility_threshold)))
+		  && simple_view->canvas_view->scale < simple->visibility_threshold)))
 	return NULL;
     }
 

Index: goocanvasimageview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimageview.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasimageview.h	16 Apr 2006 13:20:05 -0000	1.3
+++ goocanvasimageview.h	24 Apr 2006 13:53:42 -0000	1.4
@@ -42,7 +42,8 @@
 
 
 GType              goo_canvas_image_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_image_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_image_view_new      (GooCanvasView     *canvas_view,
+						   GooCanvasItemView *parent_view,
 						   GooCanvasImage    *image);
 
 

Index: goocanvasitemview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemview.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- goocanvasitemview.c	22 Apr 2006 19:17:28 -0000	1.8
+++ goocanvasitemview.c	24 Apr 2006 13:53:42 -0000	1.9
@@ -543,8 +543,8 @@
  * @cr: a cairo contect.
  * @is_pointer_event: %TRUE if the "pointer-events" properties of items should
  *  be used to determine if they should checked.
- * @parent_visible: %TRUE if the all ancestors of this item view are visible.
- * @scale: the scale to use to determine if this item view is visible.
+ * @parent_is_visible: %TRUE if the parent item view is visible (which
+ *  implies that all ancestors are also visible).
  * 
  * Gets the item view at the given point.
  * 
@@ -557,22 +557,20 @@
 				     gdouble             y,
 				     cairo_t            *cr,
 				     gboolean            is_pointer_event,
-				     gboolean            parent_visible,
-				     gdouble             scale)
+				     gboolean            parent_is_visible)
 {
   GooCanvasItemViewIface *iface = GOO_CANVAS_ITEM_VIEW_GET_IFACE (view);
 
-  return iface->get_item_at (view, x, y, cr, is_pointer_event, parent_visible,
-			     scale);
+  return iface->get_item_at (view, x, y, cr, is_pointer_event,
+			     parent_is_visible);
 }
 
 
 /**
  * goo_canvas_item_view_is_visible:
  * @view: a #GooCanvasItemView.
- * @scale: the scale setting.
  * 
- * Checks if the item is visible at the given scale setting.
+ * Checks if the item is visible.
  *
  * This entails checking the item's own visibility setting, as well as those
  * of its ancestors.
@@ -583,12 +581,11 @@
  * Returns: %TRUE if the item is visible.
  **/
 gboolean
-goo_canvas_item_view_is_visible  (GooCanvasItemView   *view,
-				  gdouble              scale)
+goo_canvas_item_view_is_visible  (GooCanvasItemView   *view)
 {
   GooCanvasItemViewIface *iface = GOO_CANVAS_ITEM_VIEW_GET_IFACE (view);
 
-  return iface->is_visible (view, scale);
+  return iface->is_visible (view);
 }
 
 

Index: goocanvasitemview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemview.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- goocanvasitemview.h	22 Apr 2006 19:17:28 -0000	1.8
+++ goocanvasitemview.h	24 Apr 2006 13:53:42 -0000	1.9
@@ -63,10 +63,8 @@
 					     gdouble              y,
 					     cairo_t             *cr,
 					     gboolean             is_pointer_event,
-					     gboolean             parent_visible,
-					     gdouble              scale);
-  gboolean             (* is_visible)	    (GooCanvasItemView   *view,
-					     gdouble              scale);
+					     gboolean             parent_is_visible);
+  gboolean             (* is_visible)	    (GooCanvasItemView   *view);
   GooCanvasBounds*     (* update)           (GooCanvasItemView   *view,
 					     gboolean             entire_tree,
 					     cairo_t             *cr);
@@ -138,10 +136,8 @@
 						     gdouble             y,
 						     cairo_t            *cr,
 						     gboolean            is_pointer_event,
-						     gboolean            parent_visible,
-						     gdouble             scale);
-gboolean           goo_canvas_item_view_is_visible  (GooCanvasItemView   *view,
-						     gdouble              scale);
+						     gboolean            parent_is_visible);
+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,

Index: goocanvasitemviewsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemviewsimple.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvasitemviewsimple.c	18 Apr 2006 23:40:44 -0000	1.4
+++ goocanvasitemviewsimple.c	24 Apr 2006 13:53:42 -0000	1.5
@@ -178,8 +178,7 @@
 					 gdouble             y,
 					 cairo_t            *cr,
 					 gboolean            is_pointer_event,
-					 gboolean            parent_visible,
-					 gdouble             scale)
+					 gboolean            parent_visible)
 {
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasItemSimple *simple = simple_view->item;
@@ -199,7 +198,7 @@
 	  && (!parent_visible
 	      || simple->visibility == GOO_CANVAS_ITEM_INVISIBLE
 	      || (simple->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-		  && scale < simple->visibility_threshold)))
+		  && simple_view->canvas_view->scale < simple->visibility_threshold)))
 	return NULL;
 
       pointer_events = simple->pointer_events;
@@ -225,19 +224,18 @@
 
 
 static gboolean
-goo_canvas_item_view_simple_is_visible  (GooCanvasItemView   *view,
-					 gdouble              scale)
+goo_canvas_item_view_simple_is_visible  (GooCanvasItemView   *view)
 {
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasItemSimple *simple = simple_view->item;
 
   if (simple->visibility == GOO_CANVAS_ITEM_INVISIBLE
       || (simple->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-	  && scale < simple->visibility_threshold))
+	  && simple_view->canvas_view->scale < simple->visibility_threshold))
     return FALSE;
 
   if (simple_view->parent_view)
-    return goo_canvas_item_view_is_visible (simple_view->parent_view, scale);
+    return goo_canvas_item_view_is_visible (simple_view->parent_view);
 
   return FALSE;
 }

Index: goocanvasitemviewsimple.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemviewsimple.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasitemviewsimple.h	18 Apr 2006 23:40:44 -0000	1.3
+++ goocanvasitemviewsimple.h	24 Apr 2006 13:53:42 -0000	1.4
@@ -46,6 +46,9 @@
 {
   GObject parent_object;
 
+  /* The canvas view. */
+  GooCanvasView *canvas_view;
+
   /* The parent view. */
   GooCanvasItemView *parent_view;
 

Index: goocanvaspath.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspath.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvaspath.c	16 Apr 2006 10:39:51 -0000	1.3
+++ goocanvaspath.c	24 Apr 2006 13:53:42 -0000	1.4
@@ -370,7 +370,8 @@
 			     GooCanvasView     *canvas_view,
 			     GooCanvasItemView *parent_view)
 {
-  return goo_canvas_path_view_new (parent_view, (GooCanvasPath*) item);
+  return goo_canvas_path_view_new (canvas_view, parent_view,
+				   (GooCanvasPath*) item);
 }
 
 

Index: goocanvaspathview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspathview.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- goocanvaspathview.c	18 Apr 2006 23:40:44 -0000	1.7
+++ goocanvaspathview.c	24 Apr 2006 13:53:42 -0000	1.8
@@ -57,6 +57,7 @@
 
 /**
  * goo_canvas_path_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @path: the path item.
  * 
@@ -68,12 +69,14 @@
  * Returns: a new #GooCanvasPathView.
  **/
 GooCanvasItemView*
-goo_canvas_path_view_new (GooCanvasItemView *parent_view,
+goo_canvas_path_view_new (GooCanvasView     *canvas_view,
+			  GooCanvasItemView *parent_view,
 			  GooCanvasPath     *path)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_PATH_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (path);
 

Index: goocanvaspathview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspathview.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvaspathview.h	16 Apr 2006 13:20:05 -0000	1.3
+++ goocanvaspathview.h	24 Apr 2006 13:53:42 -0000	1.4
@@ -42,7 +42,8 @@
 
 
 GType              goo_canvas_path_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_path_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_path_view_new      (GooCanvasView     *canvas_view,
+						  GooCanvasItemView *parent_view,
 						  GooCanvasPath     *path);
 
 

Index: goocanvaspolyline.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspolyline.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvaspolyline.c	16 Apr 2006 10:39:51 -0000	1.3
+++ goocanvaspolyline.c	24 Apr 2006 13:53:42 -0000	1.4
@@ -495,7 +495,8 @@
 				 GooCanvasView     *canvas_view,
 				 GooCanvasItemView *parent_view)
 {
-  return goo_canvas_polyline_view_new (parent_view, (GooCanvasPolyline*) item);
+  return goo_canvas_polyline_view_new (canvas_view, parent_view,
+				       (GooCanvasPolyline*) item);
 }
 
 

Index: goocanvaspolylineview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspolylineview.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- goocanvaspolylineview.c	18 Apr 2006 23:40:44 -0000	1.10
+++ goocanvaspolylineview.c	24 Apr 2006 13:53:42 -0000	1.11
@@ -56,6 +56,7 @@
 
 /**
  * goo_canvas_polyline_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @polyline: the polyline item.
  * 
@@ -67,12 +68,14 @@
  * Returns: a new #GooCanvasPolylineView.
  **/
 GooCanvasItemView*
-goo_canvas_polyline_view_new (GooCanvasItemView *parent_view,
+goo_canvas_polyline_view_new (GooCanvasView     *canvas_view,
+			      GooCanvasItemView *parent_view,
 			      GooCanvasPolyline *polyline)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_POLYLINE_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (polyline);
 
@@ -173,8 +176,7 @@
 				      gdouble             y,
 				      cairo_t            *cr,
 				      gboolean            is_pointer_event,
-				      gboolean            parent_visible,
-				      gdouble             scale)
+				      gboolean            parent_visible)
 {
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasItemSimple *simple = simple_view->item;
@@ -200,7 +202,7 @@
 	  && (!parent_visible
 	      || simple->visibility == GOO_CANVAS_ITEM_INVISIBLE
 	      || (simple->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-		  && scale < simple->visibility_threshold)))
+		  && simple_view->canvas_view->scale < simple->visibility_threshold)))
 	return NULL;
 
       pointer_events = simple->pointer_events;

Index: goocanvaspolylineview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaspolylineview.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvaspolylineview.h	16 Apr 2006 13:20:05 -0000	1.4
+++ goocanvaspolylineview.h	24 Apr 2006 13:53:42 -0000	1.5
@@ -42,7 +42,8 @@
 
 
 GType              goo_canvas_polyline_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_polyline_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_polyline_view_new      (GooCanvasView     *canvas_view,
+						      GooCanvasItemView *parent_view,
 						      GooCanvasPolyline *polyline);
 
 

Index: goocanvasrect.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasrect.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasrect.c	16 Apr 2006 10:39:51 -0000	1.3
+++ goocanvasrect.c	24 Apr 2006 13:53:42 -0000	1.4
@@ -196,7 +196,8 @@
 			     GooCanvasView     *canvas_view,
 			     GooCanvasItemView *parent_view)
 {
-  return goo_canvas_rect_view_new (parent_view, (GooCanvasRect*) item);
+  return goo_canvas_rect_view_new (canvas_view, parent_view,
+				   (GooCanvasRect*) item);
 }
 
 

Index: goocanvasrectview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasrectview.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasrectview.c	18 Apr 2006 23:40:44 -0000	1.9
+++ goocanvasrectview.c	24 Apr 2006 13:53:42 -0000	1.10
@@ -59,6 +59,7 @@
 
 /**
  * goo_canvas_rect_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @rect: the rect item.
  * 
@@ -70,12 +71,14 @@
  * Returns: a new #GooCanvasRectView.
  **/
 GooCanvasItemView*
-goo_canvas_rect_view_new (GooCanvasItemView *parent_view,
+goo_canvas_rect_view_new (GooCanvasView     *canvas_view,
+			  GooCanvasItemView *parent_view,
 			  GooCanvasRect     *rect)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_RECT_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (rect);
 

Index: goocanvasrectview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasrectview.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvasrectview.h	16 Apr 2006 13:20:05 -0000	1.3
+++ goocanvasrectview.h	24 Apr 2006 13:53:42 -0000	1.4
@@ -42,7 +42,8 @@
 
 
 GType              goo_canvas_rect_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_rect_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_rect_view_new      (GooCanvasView     *canvas_view,
+						  GooCanvasItemView *parent_view,
 						  GooCanvasRect     *rect);
 
 

Index: goocanvastext.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastext.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- goocanvastext.c	16 Apr 2006 10:39:51 -0000	1.3
+++ goocanvastext.c	24 Apr 2006 13:53:42 -0000	1.4
@@ -243,7 +243,8 @@
 			     GooCanvasView     *canvas_view,
 			     GooCanvasItemView *parent_view)
 {
-  return goo_canvas_text_view_new (parent_view, (GooCanvasText*) item);
+  return goo_canvas_text_view_new (canvas_view, parent_view,
+				   (GooCanvasText*) item);
 }
 
 

Index: goocanvastextview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastextview.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- goocanvastextview.c	18 Apr 2006 23:40:44 -0000	1.10
+++ goocanvastextview.c	24 Apr 2006 13:53:42 -0000	1.11
@@ -61,6 +61,7 @@
 
 /**
  * goo_canvas_text_view_new:
+ * @canvas_view: the canvas view.
  * @parent_view: the parent view.
  * @text: the text item.
  * 
@@ -72,12 +73,14 @@
  * Returns: a new #GooCanvasTextView.
  **/
 GooCanvasItemView*
-goo_canvas_text_view_new (GooCanvasItemView *parent_view,
+goo_canvas_text_view_new (GooCanvasView     *canvas_view,
+			  GooCanvasItemView *parent_view,
 			  GooCanvasText     *text)
 {
   GooCanvasItemViewSimple *view;
 
   view = g_object_new (GOO_TYPE_CANVAS_TEXT_VIEW, NULL);
+  view->canvas_view = canvas_view;
   view->parent_view = parent_view;
   view->item = g_object_ref (text);
 
@@ -228,8 +231,7 @@
 				  gdouble             y,
 				  cairo_t            *cr,
 				  gboolean            is_pointer_event,
-				  gboolean            parent_visible,
-				  gdouble             scale)
+				  gboolean            parent_visible)
 {
   GooCanvasItemViewSimple *simple_view = (GooCanvasItemViewSimple*) view;
   GooCanvasTextView *text_view = (GooCanvasTextView*) view;
@@ -255,7 +257,7 @@
 	  && (!parent_visible
 	      || simple->visibility == GOO_CANVAS_ITEM_INVISIBLE
 	      || (simple->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD
-		  && scale < simple->visibility_threshold)))
+		  && simple_view->canvas_view->scale < simple->visibility_threshold)))
 	return NULL;
       if (simple->pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK)
 	{

Index: goocanvastextview.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastextview.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvastextview.h	16 Apr 2006 13:20:05 -0000	1.4
+++ goocanvastextview.h	24 Apr 2006 13:53:42 -0000	1.5
@@ -45,7 +45,8 @@
 
 
 GType              goo_canvas_text_view_get_type (void) G_GNUC_CONST;
-GooCanvasItemView* goo_canvas_text_view_new      (GooCanvasItemView *parent_view,
+GooCanvasItemView* goo_canvas_text_view_new      (GooCanvasView     *canvas_view,
+						  GooCanvasItemView *parent_view,
 						  GooCanvasText     *text);
 
 

Index: goocanvasview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasview.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- goocanvasview.c	23 Apr 2006 14:01:15 -0000	1.19
+++ goocanvasview.c	24 Apr 2006 13:53:42 -0000	1.20
@@ -1457,8 +1457,7 @@
 
       cr = goo_canvas_view_create_cairo (view);
       new_item_view = goo_canvas_item_view_get_item_at (view->root_view,
-							x, y, cr, TRUE, TRUE,
-							view->scale);
+							x, y, cr, TRUE, TRUE);
       cairo_destroy (cr);
     }
 
@@ -2402,7 +2401,7 @@
   /* If the item is not a possible candidate, just return. */
   is_best = goo_canvas_view_focus_check_is_best (view, item_view, data);
 
-  if (is_best && goo_canvas_item_view_is_visible (item_view, view->scale))
+  if (is_best && goo_canvas_item_view_is_visible (item_view))
     {
       /* Check if the item view can take the focus. */
       g_object_get (item_view, "can-focus", &can_focus, NULL);



More information about the cairo-commit mailing list