Merge lp:~bratsche/libgrope/enum-type-generation into lp:libgrope

Proposed by Cody Russell
Status: Merged
Merged at revision: 5
Proposed branch: lp:~bratsche/libgrope/enum-type-generation
Merge into: lp:libgrope
Diff against target: 122 lines (+88/-1)
3 files modified
src/Makefile.am (+31/-1)
src/gropetypebuiltins.c.in (+31/-0)
src/gropetypebuiltins.h.in (+26/-0)
To merge this branch: bzr merge lp:~bratsche/libgrope/enum-type-generation
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+40490@code.launchpad.net

This proposal supersedes a proposal from 2010-11-09.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Look good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Makefile.am'
2--- src/Makefile.am 2010-10-12 15:42:04 +0000
3+++ src/Makefile.am 2010-11-09 23:16:03 +0000
4@@ -1,7 +1,31 @@
5+grope_built_public_sources = \
6+ gropetypebuiltins.h
7+
8+stamp_files = \
9+ gropetypebuiltins.h \
10+ gropetypebuiltins.c
11+
12 sources_h = \
13 gropegesturemanager.h \
14 grope.h
15
16+EXTRA_DIST = \
17+ gropetypebuiltins.h.in \
18+ gropetypebuiltins.c.in
19+
20+gropetypebuiltins.h: stamp-gropetypebuiltins.h
21+
22+stamp-gropetypebuiltins.h: $(sources_h)
23+ ( cd $(srcdir) && $(GLIB_MKENUMS) --template gropetypebuiltins.h.in \
24+ $(sources_h) ) >> xgen-gtbh \
25+ && (cmp -s xgen-gtbh gropetypebuiltins.h || cp xgen-gtbh gropetypebuiltins.h ) \
26+ && rm -f xgen-gtbh && echo timestamp > $(@F)
27+
28+gropetypebuiltins.c: stamp-gropetypebuiltins.h
29+ ( cd $(srcdir) && $(GLIB_MKENUMS) --template gropetypebuiltins.c.in \
30+ $(sources_h) ) > xgen-gtbc \
31+ && cp xgen-gtbc gropetypebuiltins.c && rm -f xgen-gtbc
32+
33 INCLUDES = \
34 -I$(srcdir) \
35 -I$(top_srcdir) \
36@@ -22,7 +46,8 @@
37 lib_LTLIBRARIES = libgrope-0.1.la
38
39 libgrope_0_1_la_SOURCES = \
40- gropegesturemanager.c
41+ gropegesturemanager.c \
42+ gropetypebuiltins.c
43
44 libgropeincludedir=$(includedir)/libgrope-0.1/libgrope
45
46@@ -34,3 +59,8 @@
47 libgrope_0_1_la_LDFLAGS = $(GTK_LT_LDFLAGS)
48
49 gropeheadersdir = $(includedir)/grope-0.1/grope
50+
51+DISTCLEANFILES = \
52+ stamp-gropetypebuiltins.h \
53+ gropetypebuiltins.h \
54+ gropetypebuiltins.c
55\ No newline at end of file
56
57=== added file 'src/gropetypebuiltins.c.in'
58--- src/gropetypebuiltins.c.in 1970-01-01 00:00:00 +0000
59+++ src/gropetypebuiltins.c.in 2010-11-09 23:16:03 +0000
60@@ -0,0 +1,31 @@
61+/*** BEGIN file-header ***/
62+#include "gropetypebuiltins.h"
63+/*** END file-header ***/
64+
65+/*** BEGIN file-production ***/
66+/* enumerations from "@filename@" */
67+#include "@filename@"
68+/*** END file-production ***/
69+
70+/*** BEGIN value-header ***/
71+GType
72+@enum_name@_get_type(void) {
73+ static GType enum_type_id = 0;
74+ if (G_UNLIKELY (!enum_type_id))
75+ {
76+ static const G@Type@Value values[] = {
77+/*** END value-header ***/
78+
79+/*** BEGIN value-production ***/
80+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
81+/*** END value-production ***/
82+
83+/*** BEGIN value-tail ***/
84+ { 0, NULL, NULL }
85+ };
86+ enum_type_id = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
87+ }
88+ return enum_type_id;
89+}
90+/*** END value-tail ***/
91+
92
93=== added file 'src/gropetypebuiltins.h.in'
94--- src/gropetypebuiltins.h.in 1970-01-01 00:00:00 +0000
95+++ src/gropetypebuiltins.h.in 2010-11-09 23:16:03 +0000
96@@ -0,0 +1,26 @@
97+/*** BEGIN file-header ***/
98+#ifndef __GROPE_ENUM_TYPES_H__
99+#define __GROPE_ENUM_TYPES_H__
100+
101+#include <glib-object.h>
102+
103+G_BEGIN_DECLS
104+
105+/*** END file-header ***/
106+
107+/*** BEGIN file-production ***/
108+/* enumerations from "@filename@" */
109+/*** END file-production ***/
110+
111+/*** BEGIN file-tail ***/
112+G_END_DECLS
113+
114+#endif /* !__GROPE_ENUM_TYPES_H__ */
115+/*** END file-tail ***/
116+
117+/*** BEGIN value-header ***/
118+GType @enum_name@_get_type (void) G_GNUC_CONST;
119+#define GROPE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
120+
121+/*** END value-header ***/
122+

Subscribers

People subscribed via source and target branches