diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-11-26 17:32:19 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-11-26 17:32:19 +0000 |
commit | 4077924a7c531d4059a6a71019f581e692e772e0 (patch) | |
tree | 96bcdc1f53381a20ca0b7d1b18a00fba1c91c1a2 /gdk-pixbuf | |
parent | 3cbd314f714077f94063fa2731600237a32fd7e0 (diff) | |
download | gdk-pixbuf-4077924a7c531d4059a6a71019f581e692e772e0.tar.gz |
Use templates for glib-mkenums calls instead of complicated commandlines
2007-11-26 Matthias Clasen <mclasen@redhat.com>
Use templates for glib-mkenums calls instead of
complicated commandlines in Makefiles. (#429910)
* gdk-pixbuf/Makefile.am:
* gdk/Makefile.am:
* gtk/Makefile.am:
* perf/Makefile.am: Use templates for glib-mkenums
* gdk-pixbuf/gdk-pixbuf-enum-types.[ch].template:
* gdk/gdkenumtypes.[ch].template:
* gtk/gtktypebuiltings.[ch].template:
* perf/typebuiltins.[ch].template: The templates
svn path=/trunk/; revision=19053
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/Makefile.am | 20 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-enum-types.c.template | 38 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-enum-types.h.template | 24 |
3 files changed, 68 insertions, 14 deletions
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am index 51904bf24..a9c5ece84 100644 --- a/gdk-pixbuf/Makefile.am +++ b/gdk-pixbuf/Makefile.am @@ -442,12 +442,8 @@ MAINTAINERCLEANFILES = \ gdk-pixbuf-enum-types.h: s-enum-types-h @true -s-enum-types-h: @REBUILD@ $(gdk_pixbuf_headers) Makefile - ( cd $(srcdir) && $(GLIB_MKENUMS) \ - --fhead "#ifndef __GDK_PIXBUF_ENUM_TYPES_H__\n#define __GDK_PIXBUF_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ - --fprod "/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __GDK_PIXBUF_ENUM_TYPES_H__ */" \ +s-enum-types-h: @REBUILD@ $(gdk_pixbuf_headers) gdk-pixbuf-enum-types.h.template + ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdk-pixbuf-enum-types.h.template \ $(gdk_pixbuf_headers) ) > tmp-gdk-pixbuf-enum-types.h \ && (cmp -s tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h || cp tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h ) \ && rm -f tmp-gdk-pixbuf-enum-types.h \ @@ -459,14 +455,8 @@ MAINTAINERCLEANFILES += s-enum-types-h # # gdk-pixbuf-enum-types.c # -gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile - (cd $(srcdir) && $(GLIB_MKENUMS) \ - --fhead "#include <gdk-pixbuf/gdk-pixbuf.h>\n#include \"gdk-pixbuf-alias.h\"\n" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --ftail "\n#define __GDK_PIXBUF_ENUM_TYPES_C__\n#include \"gdk-pixbuf-aliasdef.c\"" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ +gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) gdk-pixbuf-enum-types.c.template + (cd $(srcdir) && $(GLIB_MKENUMS) --template gdk-pixbuf-enum-types.c.template \ $(gdk_pixbuf_headers)) > gdk-pixbuf-enum-types.c # @@ -512,6 +502,8 @@ EXTRA_DIST += \ gdk_pixbuf.rc \ gdk-pixbuf-marshal.c \ gdk-pixbuf-marshal.list \ + gdk-pixbuf-enum-types.c.template \ + gdk-pixbuf-enum-types.h.template \ gen-color-table.pl if CROSS_COMPILING diff --git a/gdk-pixbuf/gdk-pixbuf-enum-types.c.template b/gdk-pixbuf/gdk-pixbuf-enum-types.c.template new file mode 100644 index 000000000..8496c13a5 --- /dev/null +++ b/gdk-pixbuf/gdk-pixbuf-enum-types.c.template @@ -0,0 +1,38 @@ +/*** BEGIN file-header ***/ +#include <gdk-pixbuf/gdk-pixbuf.h> +#include "gdk-pixbuf-alias.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static GType etype = 0; + + if (G_UNLIKELY(etype == 0)) { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + } + return etype; +} + +/*** END value-tail ***/ + +/*** BEGIN file-tail ***/ +#define __GDK_PIXBUF_ENUM_TYPES_C__ +#include "gdk-pixbuf-aliasdef.c" +/*** END file-tail ***/ diff --git a/gdk-pixbuf/gdk-pixbuf-enum-types.h.template b/gdk-pixbuf/gdk-pixbuf-enum-types.h.template new file mode 100644 index 000000000..0df6adb1c --- /dev/null +++ b/gdk-pixbuf/gdk-pixbuf-enum-types.h.template @@ -0,0 +1,24 @@ +/*** BEGIN file-header ***/ +#ifndef __GDK_PIXBUF_ENUM_TYPES_H__ +#define __GDK_PIXBUF_ENUM_TYPES_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __GDK_PIXBUF_ENUM_TYPES_H__ */ +/*** END file-tail ***/ |