summaryrefslogtreecommitdiffstats
path: root/src/uca-enums.h.template
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-12 10:21:55 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-12 10:21:55 +0200
commit580dae2183e27ccec00f127b85188df143f49c54 (patch)
tree35e43a1587a8b624218006e2e41d73c28dd1b160 /src/uca-enums.h.template
parent733da14c66d347bb2ae452766a36bf3c1381cacd (diff)
downloaduca-580dae2183e27ccec00f127b85188df143f49c54.tar.gz
uca-580dae2183e27ccec00f127b85188df143f49c54.tar.bz2
uca-580dae2183e27ccec00f127b85188df143f49c54.tar.xz
uca-580dae2183e27ccec00f127b85188df143f49c54.zip
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.
Diffstat (limited to 'src/uca-enums.h.template')
-rw-r--r--src/uca-enums.h.template25
1 files changed, 25 insertions, 0 deletions
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 <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 UCA_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* !UCA_ENUMS_H */
+/*** END file-tail ***/