From 580dae2183e27ccec00f127b85188df143f49c54 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 12 Jun 2012 10:21:55 +0200 Subject: Generate enum types from source It became a little unwieldy to create the enum types manually via g_enums_register_static(). This changeset creates the types from enum definitions in public headers using glib2-mkenum. Be sure to include uca-enums.h in every source file that needs to know GObject enum type. --- src/uca-enums.h.template | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/uca-enums.h.template (limited to 'src/uca-enums.h.template') diff --git a/src/uca-enums.h.template b/src/uca-enums.h.template new file mode 100644 index 0000000..e9d00b9 --- /dev/null +++ b/src/uca-enums.h.template @@ -0,0 +1,25 @@ +/*** BEGIN file-header ***/ + +#ifndef UCA_ENUMS_H +#define UCA_ENUMS_H + +#include + +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 UCA_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* !UCA_ENUMS_H */ +/*** END file-tail ***/ -- cgit v1.2.3