[cairo-commit] goocanvas/src goocanvas.h, 1.11, 1.12 goocanvasitem.c, 1.28, 1.29 goocanvasitem.h, 1.20, 1.21 goocanvasitemmodel.h, 1.11, 1.12 goocanvasitemsimple.h, 1.22, 1.23 goocanvasprivate.h, 1.4, 1.5 goocanvasutils.c, 1.13, 1.14

Damon Chaplin commit at pdx.freedesktop.org
Fri Mar 30 04:40:37 PDT 2007


Committed by: damon

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

Modified Files:
	goocanvas.h goocanvasitem.c goocanvasitem.h 
	goocanvasitemmodel.h goocanvasitemsimple.h goocanvasprivate.h 
	goocanvasutils.c 
Log Message:
2007-03-30  Damon Chaplin  <damon at gnome.org>

	* src/goocanvasutils.c (goo_canvas_boolean_handled_accumulator): new
	function, copied from _gtk_boolean_handled_accumulator().

	* src/goocanvasitem.c (goo_canvas_item_base_init): use the above
	accumulator for the event signals, so returning TRUE from a handler
	stops the signal.

	* src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): 
	* src/goocanvasitem.h (struct _GooCanvasItemIface): added a few bits
	that will be needed to support tooltips with GTK+ 2.12. I have a patch
	to support tooltips but I don't want to depend on GTK+ 2.12 yet.



Index: goocanvas.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvas.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- goocanvas.h	6 Mar 2007 13:39:16 -0000	1.11
+++ goocanvas.h	30 Mar 2007 11:40:28 -0000	1.12
@@ -162,6 +162,10 @@
   void (*_goo_canvas_reserved2) (void);
   void (*_goo_canvas_reserved3) (void);
   void (*_goo_canvas_reserved4) (void);
+  void (*_goo_canvas_reserved5) (void);
+  void (*_goo_canvas_reserved6) (void);
+  void (*_goo_canvas_reserved7) (void);
+  void (*_goo_canvas_reserved8) (void);
 };
 
 

Index: goocanvasitem.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitem.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- goocanvasitem.c	8 Mar 2007 13:58:45 -0000	1.28
+++ goocanvasitem.c	30 Mar 2007 11:40:28 -0000	1.29
@@ -131,7 +131,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       enter_notify_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -155,7 +155,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       leave_notify_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -179,7 +179,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       motion_notify_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -203,7 +203,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       button_press_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -227,7 +227,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       button_release_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -253,7 +253,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       focus_in_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -276,7 +276,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       focus_out_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -300,7 +300,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       key_press_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -324,7 +324,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       key_release_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,
@@ -349,7 +349,7 @@
 		      G_SIGNAL_RUN_LAST,
 		      G_STRUCT_OFFSET (GooCanvasItemIface,
 				       grab_broken_event),
-		      NULL, NULL,
+		      goo_canvas_boolean_handled_accumulator, NULL,
 		      goo_canvas_marshal_BOOLEAN__OBJECT_BOXED,
 		      G_TYPE_BOOLEAN, 2,
 		      GOO_TYPE_CANVAS_ITEM,

Index: goocanvasitem.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitem.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- goocanvasitem.h	8 Mar 2007 13:58:45 -0000	1.20
+++ goocanvasitem.h	30 Mar 2007 11:40:28 -0000	1.21
@@ -270,11 +270,23 @@
 
   /*< private >*/
 
+  /* We might use this in future to support tooltips. */
+  gboolean		(* query_tooltip)		(GooCanvasItem		*item,
+							 gdouble		 x,
+							 gdouble		 y,
+							 gboolean		 keyboard_tooltip,
+							 gpointer /*GtkTooltip*/		*tooltip);
+
+
   /* Padding for future expansion */
   void (*_goo_canvas_reserved1) (void);
   void (*_goo_canvas_reserved2) (void);
   void (*_goo_canvas_reserved3) (void);
   void (*_goo_canvas_reserved4) (void);
+  void (*_goo_canvas_reserved5) (void);
+  void (*_goo_canvas_reserved6) (void);
+  void (*_goo_canvas_reserved7) (void);
+  void (*_goo_canvas_reserved8) (void);
 };
 
 

Index: goocanvasitemmodel.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemmodel.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- goocanvasitemmodel.h	8 Mar 2007 13:58:45 -0000	1.11
+++ goocanvasitemmodel.h	30 Mar 2007 11:40:28 -0000	1.12
@@ -142,6 +142,10 @@
   void (*_goo_canvas_reserved2) (void);
   void (*_goo_canvas_reserved3) (void);
   void (*_goo_canvas_reserved4) (void);
+  void (*_goo_canvas_reserved5) (void);
+  void (*_goo_canvas_reserved6) (void);
+  void (*_goo_canvas_reserved7) (void);
+  void (*_goo_canvas_reserved8) (void);
 };
 
 

Index: goocanvasitemsimple.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemsimple.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- goocanvasitemsimple.h	16 Mar 2007 12:52:27 -0000	1.22
+++ goocanvasitemsimple.h	30 Mar 2007 11:40:28 -0000	1.23
@@ -41,6 +41,12 @@
   GooCanvasStyle *style;
   cairo_matrix_t *transform;
   GArray *clip_path_commands;
+
+  /*< private >*/
+  /* We will store tooltips here in future. */
+  gchar *tooltip;
+
+  /*< public >*/
   gdouble visibility_threshold;
   guint visibility			: 2;
   guint pointer_events			: 4;
@@ -51,6 +57,8 @@
   /*< private >*/
   /* We might use this in future for a cache setting - never/always/visible. */
   guint cache_setting			: 3;
+  /* We might need this for tooltips in future. */
+  guint has_tooltip			: 1;
 };
 
 

Index: goocanvasprivate.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasprivate.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- goocanvasprivate.h	12 Oct 2006 13:16:56 -0000	1.4
+++ goocanvasprivate.h	30 Mar 2007 11:40:28 -0000	1.5
@@ -31,6 +31,12 @@
 cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf);
 
 
+gboolean goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint,
+						 GValue                *return_accu,
+						 const GValue          *handler_return,
+						 gpointer               dummy);
+
+
 G_END_DECLS
 
 #endif /* __GOO_CANVAS_PRIVATE_H__ */

Index: goocanvasutils.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasutils.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- goocanvasutils.c	6 Mar 2007 13:21:26 -0000	1.13
+++ goocanvasutils.c	30 Mar 2007 11:40:28 -0000	1.14
@@ -1150,5 +1150,22 @@
 }
 
 
+/* This is a copy of _gtk_boolean_handled_accumulator. */
+gboolean
+goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint,
+					GValue                *return_accu,
+					const GValue          *handler_return,
+					gpointer               dummy)
+{
+  gboolean continue_emission;
+  gboolean signal_handled;
+  
+  signal_handled = g_value_get_boolean (handler_return);
+  g_value_set_boolean (return_accu, signal_handled);
+  continue_emission = !signal_handled;
+  
+  return continue_emission;
+}
+
 
 



More information about the cairo-commit mailing list