[gnome-flashback] screensaver: add template for enum type generation
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] screensaver: add template for enum type generation
- Date: Tue, 10 Dec 2019 21:34:59 +0000 (UTC)
commit 737e1b8b436c94a629b59450ebb13c8ad50c57aa
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Dec 10 22:04:16 2019 +0200
screensaver: add template for enum type generation
gnome-flashback/libscreensaver/Makefile.am | 15 ++++++++
.../libscreensaver/gf-screensaver-enum-types.c.in | 41 ++++++++++++++++++++++
.../libscreensaver/gf-screensaver-enum-types.h.in | 21 +++++++++++
3 files changed, 77 insertions(+)
---
diff --git a/gnome-flashback/libscreensaver/Makefile.am b/gnome-flashback/libscreensaver/Makefile.am
index 596223f..acdad6d 100644
--- a/gnome-flashback/libscreensaver/Makefile.am
+++ b/gnome-flashback/libscreensaver/Makefile.am
@@ -42,6 +42,17 @@ libscreensaver_la_LIBADD = \
$(SCREENSAVER_LIBS) \
$(NULL)
+ENUM_TYPES = \
+ $(NULL)
+
+gf-screensaver-enum-types.c: gf-screensaver-enum-types.c.in gf-screensaver-enum-types.h $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/gf-screensaver-enum-types.c.in $(ENUM_TYPES) > \
+ gf-screensaver-enum-types.c.tmp && mv gf-screensaver-enum-types.c.tmp
gf-screensaver-enum-types.c
+
+gf-screensaver-enum-types.h: gf-screensaver-enum-types.h.in $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/gf-screensaver-enum-types.h.in $(ENUM_TYPES) > \
+ gf-screensaver-enum-types.h.tmp && mv gf-screensaver-enum-types.h.tmp
gf-screensaver-enum-types.h
+
gf-accounts-gen.h:
gf-accounts-gen.c: org.freedesktop.Accounts.xml
$(AM_V_GEN) $(GDBUS_CODEGEN) --c-namespace Gf \
@@ -103,6 +114,8 @@ BUILT_SOURCES = \
gf-login-seat-gen.h \
gf-login-session-gen.c \
gf-login-session-gen.h \
+ gf-screensaver-enum-types.c \
+ gf-screensaver-enum-types.h \
gf-screensaver-gen.c \
gf-screensaver-gen.h \
gf-sm-presence-gen.c \
@@ -110,6 +123,8 @@ BUILT_SOURCES = \
$(NULL)
EXTRA_DIST = \
+ gf-screensaver-enum-types.c.in \
+ gf-screensaver-enum-types.h.in \
org.freedesktop.Accounts.xml \
org.freedesktop.Accounts.User.xml \
org.freedesktop.DisplayManager.Seat.xml \
diff --git a/gnome-flashback/libscreensaver/gf-screensaver-enum-types.c.in
b/gnome-flashback/libscreensaver/gf-screensaver-enum-types.c.in
new file mode 100644
index 0000000..ba845f5
--- /dev/null
+++ b/gnome-flashback/libscreensaver/gf-screensaver-enum-types.c.in
@@ -0,0 +1,41 @@
+/*** BEGIN file-header ***/
+#include "config.h"
+#include "gf-screensaver-enum-types.h"
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+#include "@filename@"
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+
+GType
+@enum_name@_get_type (void)
+{
+ static volatile gsize g_enum_type_id;
+ static const G@Type@Value values[] =
+ {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+
+ if (g_once_init_enter (&g_enum_type_id))
+ {
+ const gchar *string;
+ GType id;
+
+ string = g_intern_static_string ("@EnumName@");
+ id = g_@type@_register_static (string, values);
+
+ g_once_init_leave (&g_enum_type_id, id);
+ }
+
+ return g_enum_type_id;
+}
+/*** END value-tail ***/
diff --git a/gnome-flashback/libscreensaver/gf-screensaver-enum-types.h.in
b/gnome-flashback/libscreensaver/gf-screensaver-enum-types.h.in
new file mode 100644
index 0000000..00db537
--- /dev/null
+++ b/gnome-flashback/libscreensaver/gf-screensaver-enum-types.h.in
@@ -0,0 +1,21 @@
+/*** BEGIN file-header ***/
+#ifndef GF_SCREENSAVER_ENUM_TYPES_H
+#define GF_SCREENSAVER_ENUM_TYPES_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/*** END file-header ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
+
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif
+/*** END file-tail ***/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]