[cairo-commit] goocanvas/src Makefile.am, 1.8, 1.9 goocanvas.h, 1.1, 1.2 goocanvasitem.c, 1.9, 1.10 goocanvasutils.c, 1.6, 1.7 goocanvasutils.h, 1.6, 1.7

Damon Chaplin commit at pdx.freedesktop.org
Thu Oct 12 05:53:50 PDT 2006


Committed by: damon

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

Modified Files:
	Makefile.am goocanvas.h goocanvasitem.c goocanvasutils.c 
	goocanvasutils.h 
Log Message:
2006-10-12  Damon Chaplin  <damon at gnome.org>

	Applied patch from Paul Davis to use glib_mkenums, slightly modified:

	* configure.in: use pkg-config to get the glib_genmarshal and
	glib_mkenums binaries.

	* src/Makefile.am: use glib_mkenums to generate goocanvasenums.[hc].

	* src/goocanvasutils.c: removed goo_canvas_pointer_events_get_type()
	and goo_canvas_item_visibility_get_type() as they're generated now.

	* src/goocanvasutils.h: removed get_type() declarations that are now
	in goocanvasenums.h, and modifed GooCanvasPointerEvents so glib_mkenums
	could parse it.

	* src/goocanvas.h: 
	* src/goocanvasitem.c: include goocanvasenums.h.



Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/goocanvas/src/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am	18 Apr 2006 15:43:07 -0000	1.8
+++ Makefile.am	12 Oct 2006 12:53:47 -0000	1.9
@@ -15,7 +15,7 @@
 
 libgoocanvasincludedir = $(includedir)/goocanvas-1.0
 
-libgoocanvasinclude_HEADERS =			\
+libgoocanvas_public_headers =			\
 	goocanvasellipse.h			\
 	goocanvasellipseview.h			\
 	goocanvasgroup.h			\
@@ -46,6 +46,7 @@
 	goocanvasatk.c				\
 	goocanvasellipse.c			\
 	goocanvasellipseview.c			\
+	goocanvasenumtypes.c			\
 	goocanvasgroup.c			\
 	goocanvasgroupview.c			\
 	goocanvasimage.c			\
@@ -68,6 +69,36 @@
 	goocanvasutils.c			\
 	goocanvasview.c 
 
+libgoocanvas_built_headers =			\
+	goocanvasenumtypes.h			\
+	goocanvasmarshal.h
+
+libgoocanvas_built_sources =			\
+	goocanvasenumtypes.c
+
+libgoocanvasinclude_HEADERS =			\
+	$(goo_canvas_public_headers)		\
+	$(goo_canvas_built_headers)
+
+
+goocanvasenumtypes.h: $(goo_canvas_public_headers) Makefile
+	(cd $(srcdir) && $(GLIB_MKENUMS) \
+		--fhead "#ifndef __GOO_CANVAS_ENUM_TYPES_H__\n#define __GOO_CANVAS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+		--fprod "/* Enumerations from \"@filename@\" */\n" \
+		--vhead "GType @enum_name at _get_type (void);\n#define GOO_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n\n\n" \
+		--ftail "G_END_DECLS\n\n#endif /* __GOO_CANVAS_ENUM_TYPES_H__ */" \
+		$(libgoocanvas_public_headers)) > $@
+
+goocanvasenumtypes.c: $(goo_canvas_public_headers) Makefile
+	(cd $(srcdir) && $(GLIB_MKENUMS) \
+		--fhead "#include <goocanvas.h>\n" \
+		--fhead "#include <glib-object.h>\n" \
+		--fprod "\n/* Enumerations from \"@filename@\" */" \
+		--vhead "GType\n at enum_name@_get_type (void)\n{\n  static GType etype = 0;\n if( etype == 0 ) \n  {\n    static const G at Type@Value values[] = {" \
+		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ at type@_register_static (\"@EnumName@\", values );\n  }\n  return etype;\n}\n" \
+		$(libgoocanvas_public_headers)) > $@
+
 
 GENMARSHAL_COMMAND = $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal
 SUFFIXES = .list
@@ -81,9 +112,9 @@
 	$(GENMARSHAL_COMMAND) --body $< ) >$@
 
 # A hint is needed to build the header first:
-BUILT_SOURCES = goocanvasmarshal.h
+BUILT_SOURCES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources)
 
 # Another hint, see bugs #172211 and #172212:
 non-intermediate: goocanvasmarshal.c
 
-CLEANFILES = goocanvasmarshal.h goocanvasmarshal.c
+CLEANFILES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources)

Index: goocanvas.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvas.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- goocanvas.h	12 Apr 2006 10:45:52 -0000	1.1
+++ goocanvas.h	12 Oct 2006 12:53:47 -0000	1.2
@@ -9,6 +9,7 @@
 
 #include <goocanvasellipse.h>
 #include <goocanvasellipseview.h>
+#include <goocanvasenumtypes.h>
 #include <goocanvasgroup.h>
 #include <goocanvasgroupview.h>
 #include <goocanvasimage.h>

Index: goocanvasitem.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitem.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasitem.c	19 Jul 2006 13:52:33 -0000	1.9
+++ goocanvasitem.c	12 Oct 2006 12:53:47 -0000	1.10
@@ -18,6 +18,7 @@
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
 #include "goocanvasprivate.h"
+#include <goocanvasenumtypes.h>
 #include "goocanvasitem.h"
 #include "goocanvasutils.h"
 #include "goocanvasmarshal.h"

Index: goocanvasutils.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasutils.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- goocanvasutils.c	15 Aug 2006 10:08:25 -0000	1.6
+++ goocanvasutils.c	12 Oct 2006 12:53:47 -0000	1.7
@@ -86,55 +86,6 @@
 
 
 /*
- * Enum types.
- */
-GType
-goo_canvas_pointer_events_get_type (void)
-{
-  static GType etype = 0;
-  if (etype == 0) {
-    static const GFlagsValue values[] = {
-      { GOO_CANVAS_EVENTS_VISIBLE_MASK, "GOO_CANVAS_EVENTS_VISIBLE_MASK", "visible-mask" },
-      { GOO_CANVAS_EVENTS_PAINTED_MASK, "GOO_CANVAS_EVENTS_PAINTED_MASK", "painted-mask" },
-      { GOO_CANVAS_EVENTS_FILL_MASK, "GOO_CANVAS_EVENTS_FILL_MASK", "fill-mask" },
-      { GOO_CANVAS_EVENTS_STROKE_MASK, "GOO_CANVAS_EVENTS_STROKE_MASK", "stroke-mask" },
-      { GOO_CANVAS_EVENTS_NONE, "GOO_CANVAS_EVENTS_NONE", "none" },
-      { GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "GOO_CANVAS_EVENTS_VISIBLE_PAINTED", "visible-painted" },
-      { GOO_CANVAS_EVENTS_VISIBLE_FILL, "GOO_CANVAS_EVENTS_VISIBLE_FILL", "visible-fill" },
-      { GOO_CANVAS_EVENTS_VISIBLE_STROKE, "GOO_CANVAS_EVENTS_VISIBLE_STROKE", "visible-stroke" },
-      { GOO_CANVAS_EVENTS_VISIBLE, "GOO_CANVAS_EVENTS_VISIBLE", "visible" },
-      { GOO_CANVAS_EVENTS_PAINTED, "GOO_CANVAS_EVENTS_PAINTED", "painted" },
-      { GOO_CANVAS_EVENTS_FILL, "GOO_CANVAS_EVENTS_FILL", "fill" },
-      { GOO_CANVAS_EVENTS_STROKE, "GOO_CANVAS_EVENTS_STROKE", "stroke" },
-      { GOO_CANVAS_EVENTS_ALL, "GOO_CANVAS_EVENTS_ALL", "all" },
-      { 0, NULL, NULL }
-    };
-    etype = g_flags_register_static ("GooCanvasPointerEvents", values);
-  }
-  return etype;
-}
-
-
-GType
-goo_canvas_item_visibility_get_type (void)
-{
-  static GType etype = 0;
-  if (etype == 0) {
-    static const GEnumValue values[] = {
-      { GOO_CANVAS_ITEM_VISIBLE, "GOO_CANVAS_ITEM_VISIBLE", "visible" },
-      { GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD", "visible-above-threshold" },
-      { GOO_CANVAS_ITEM_INVISIBLE, "GOO_CANVAS_ITEM_INVISIBLE", "invisible" },
-      { 0, NULL, NULL }
-    };
-    etype = g_enum_register_static ("GooCanvasItemVisibility", values);
-  }
-  return etype;
-}
-
-
-
-
-/*
  * Cairo utilities.
  */
 

Index: goocanvasutils.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasutils.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- goocanvasutils.h	15 Aug 2006 10:08:25 -0000	1.6
+++ goocanvasutils.h	12 Oct 2006 12:53:47 -0000	1.7
@@ -15,8 +15,6 @@
 /*
  * Enum types.
  */
-#define GOO_TYPE_CANVAS_POINTER_EVENTS   (goo_canvas_pointer_events_get_type ())
-GType goo_canvas_pointer_events_get_type   (void) G_GNUC_CONST;
 
 /**
  * GooCanvasPointerEvents
@@ -65,31 +63,18 @@
 
   GOO_CANVAS_EVENTS_NONE		= 0,
 
-  GOO_CANVAS_EVENTS_VISIBLE_PAINTED	= GOO_CANVAS_EVENTS_VISIBLE_MASK
-					  | GOO_CANVAS_EVENTS_PAINTED_MASK
-					  | GOO_CANVAS_EVENTS_FILL_MASK
-					  | GOO_CANVAS_EVENTS_STROKE_MASK,
-  GOO_CANVAS_EVENTS_VISIBLE_FILL	= GOO_CANVAS_EVENTS_VISIBLE_MASK
-					  | GOO_CANVAS_EVENTS_FILL_MASK,
-  GOO_CANVAS_EVENTS_VISIBLE_STROKE	= GOO_CANVAS_EVENTS_VISIBLE_MASK
-					  | GOO_CANVAS_EVENTS_STROKE_MASK,
-  GOO_CANVAS_EVENTS_VISIBLE		= GOO_CANVAS_EVENTS_VISIBLE_MASK
-					  | GOO_CANVAS_EVENTS_FILL_MASK
-					  | GOO_CANVAS_EVENTS_STROKE_MASK,
+  GOO_CANVAS_EVENTS_VISIBLE_PAINTED	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
+  GOO_CANVAS_EVENTS_VISIBLE_FILL	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK,
+  GOO_CANVAS_EVENTS_VISIBLE_STROKE	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
+  GOO_CANVAS_EVENTS_VISIBLE		= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
 
-  GOO_CANVAS_EVENTS_PAINTED		= GOO_CANVAS_EVENTS_PAINTED_MASK
-					  | GOO_CANVAS_EVENTS_FILL_MASK
-					  | GOO_CANVAS_EVENTS_STROKE_MASK,
+  GOO_CANVAS_EVENTS_PAINTED		= GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
   GOO_CANVAS_EVENTS_FILL		= GOO_CANVAS_EVENTS_FILL_MASK,
   GOO_CANVAS_EVENTS_STROKE		= GOO_CANVAS_EVENTS_STROKE_MASK,
-  GOO_CANVAS_EVENTS_ALL			= GOO_CANVAS_EVENTS_FILL_MASK
-					  | GOO_CANVAS_EVENTS_STROKE_MASK
+  GOO_CANVAS_EVENTS_ALL			= GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK
 } GooCanvasPointerEvents;
 
 
-#define GOO_TYPE_CANVAS_ITEM_VISIBILITY   (goo_canvas_item_visibility_get_type ())
-GType goo_canvas_item_visibility_get_type   (void) G_GNUC_CONST;
-
 /**
  * GooCanvasItemVisibility
  * @GOO_CANVAS_ITEM_VISIBLE: the item is visible.



More information about the cairo-commit mailing list