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
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2010-10-12 15:42:04 +0000
+++ src/Makefile.am 2010-11-09 23:16:03 +0000
@@ -1,7 +1,31 @@
1grope_built_public_sources = \
2 gropetypebuiltins.h
3
4stamp_files = \
5 gropetypebuiltins.h \
6 gropetypebuiltins.c
7
1sources_h = \8sources_h = \
2 gropegesturemanager.h \9 gropegesturemanager.h \
3 grope.h10 grope.h
411
12EXTRA_DIST = \
13 gropetypebuiltins.h.in \
14 gropetypebuiltins.c.in
15
16gropetypebuiltins.h: stamp-gropetypebuiltins.h
17
18stamp-gropetypebuiltins.h: $(sources_h)
19 ( cd $(srcdir) && $(GLIB_MKENUMS) --template gropetypebuiltins.h.in \
20 $(sources_h) ) >> xgen-gtbh \
21 && (cmp -s xgen-gtbh gropetypebuiltins.h || cp xgen-gtbh gropetypebuiltins.h ) \
22 && rm -f xgen-gtbh && echo timestamp > $(@F)
23
24gropetypebuiltins.c: stamp-gropetypebuiltins.h
25 ( cd $(srcdir) && $(GLIB_MKENUMS) --template gropetypebuiltins.c.in \
26 $(sources_h) ) > xgen-gtbc \
27 && cp xgen-gtbc gropetypebuiltins.c && rm -f xgen-gtbc
28
5INCLUDES = \29INCLUDES = \
6 -I$(srcdir) \30 -I$(srcdir) \
7 -I$(top_srcdir) \31 -I$(top_srcdir) \
@@ -22,7 +46,8 @@
22lib_LTLIBRARIES = libgrope-0.1.la46lib_LTLIBRARIES = libgrope-0.1.la
2347
24libgrope_0_1_la_SOURCES = \48libgrope_0_1_la_SOURCES = \
25 gropegesturemanager.c49 gropegesturemanager.c \
50 gropetypebuiltins.c
2651
27libgropeincludedir=$(includedir)/libgrope-0.1/libgrope52libgropeincludedir=$(includedir)/libgrope-0.1/libgrope
2853
@@ -34,3 +59,8 @@
34libgrope_0_1_la_LDFLAGS = $(GTK_LT_LDFLAGS)59libgrope_0_1_la_LDFLAGS = $(GTK_LT_LDFLAGS)
3560
36gropeheadersdir = $(includedir)/grope-0.1/grope61gropeheadersdir = $(includedir)/grope-0.1/grope
62
63DISTCLEANFILES = \
64 stamp-gropetypebuiltins.h \
65 gropetypebuiltins.h \
66 gropetypebuiltins.c
37\ No newline at end of file67\ No newline at end of file
3868
=== added file 'src/gropetypebuiltins.c.in'
--- src/gropetypebuiltins.c.in 1970-01-01 00:00:00 +0000
+++ src/gropetypebuiltins.c.in 2010-11-09 23:16:03 +0000
@@ -0,0 +1,31 @@
1/*** BEGIN file-header ***/
2#include "gropetypebuiltins.h"
3/*** END file-header ***/
4
5/*** BEGIN file-production ***/
6/* enumerations from "@filename@" */
7#include "@filename@"
8/*** END file-production ***/
9
10/*** BEGIN value-header ***/
11GType
12@enum_name@_get_type(void) {
13 static GType enum_type_id = 0;
14 if (G_UNLIKELY (!enum_type_id))
15 {
16 static const G@Type@Value values[] = {
17/*** END value-header ***/
18
19/*** BEGIN value-production ***/
20 { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
21/*** END value-production ***/
22
23/*** BEGIN value-tail ***/
24 { 0, NULL, NULL }
25 };
26 enum_type_id = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
27 }
28 return enum_type_id;
29}
30/*** END value-tail ***/
31
032
=== added file 'src/gropetypebuiltins.h.in'
--- src/gropetypebuiltins.h.in 1970-01-01 00:00:00 +0000
+++ src/gropetypebuiltins.h.in 2010-11-09 23:16:03 +0000
@@ -0,0 +1,26 @@
1/*** BEGIN file-header ***/
2#ifndef __GROPE_ENUM_TYPES_H__
3#define __GROPE_ENUM_TYPES_H__
4
5#include <glib-object.h>
6
7G_BEGIN_DECLS
8
9/*** END file-header ***/
10
11/*** BEGIN file-production ***/
12/* enumerations from "@filename@" */
13/*** END file-production ***/
14
15/*** BEGIN file-tail ***/
16G_END_DECLS
17
18#endif /* !__GROPE_ENUM_TYPES_H__ */
19/*** END file-tail ***/
20
21/*** BEGIN value-header ***/
22GType @enum_name@_get_type (void) G_GNUC_CONST;
23#define GROPE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
24
25/*** END value-header ***/
26

Subscribers

People subscribed via source and target branches