[evolution-kolab/account-mgmt: 6/6] Generate GEnumTypes from kolab-types.h.



commit f5a000314789de4d5fe7a752e05aecb5dde167e0
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Jun 26 12:31:07 2012 -0400

    Generate GEnumTypes from kolab-types.h.
    
    To be used to CamelKolabIMAPXSettings properties.

 src/libekolab/Makefile.am   |   26 ++++++++++++++++++++++++++
 src/libekolab/kolab-types.h |   18 +++++++++---------
 2 files changed, 35 insertions(+), 9 deletions(-)
---
diff --git a/src/libekolab/Makefile.am b/src/libekolab/Makefile.am
index edf8291..8641bf7 100644
--- a/src/libekolab/Makefile.am
+++ b/src/libekolab/Makefile.am
@@ -19,7 +19,29 @@ AM_CPPFLAGS =			\
 
 ## --- libekolab ---------------------------------------------------------------
 
+kolab-enumtypes.h: kolab-types.h
+	$(AM_V_GEN) glib-mkenums \
+	--fhead "#ifndef KOLAB_ENUM_TYPES_H\n#define KOLAB_ENUM_TYPES_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+	--fprod "/* enumerations from \"@filename \" */\n" \
+	--vhead "GType @enum_name _get_type (void);\n#define KOLAB_TYPE_ ENUMSHORT@ (@enum_name _get_type())\n" \
+	--ftail "G_END_DECLS\n\n#endif /* KOLAB_ENUM_TYPES_H */" \
+	$^ > $@
+
+kolab-enumtypes.c: kolab-types.h
+	$(AM_V_GEN) glib-mkenums \
+	--fhead "#include <$<>\n#include \"kolab-enumtypes.h\"" \
+	--fprod "\n/* enumerations from \"@filename \" */" \
+	--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {" \
+	--vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
+	--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName \", values);\n  }\n  return etype;\n}\n" \
+	$^ > $@
+
+ENUM_GENERATED =			\
+	kolab-enumtypes.h		\
+	kolab-enumtypes.c
+
 libekolab_la_SOURCES =			\
+	kolab-enumtypes.c		\
 	kolab-data-folder-metadata.c	\
 	kolab-data-folder-permissions.c	\
 	kolab-data-imap-account.c	\
@@ -30,6 +52,7 @@ noinst_HEADERS =			\
 	kolab-data-folder-metadata.h	\
 	kolab-data-folder-permissions.h	\
 	kolab-data-imap-account.h	\
+	kolab-enumtypes.h		\
 	kolab-folder-summary.h		\
 	kolab-mail-access.h		\
 	kolab-mail-handle-friend.h	\
@@ -98,7 +121,10 @@ libekolabbackend_la_LIBADD =			\
 
 ## --- module ------------------------------------------------------------------
 
+BUILT_SOURCES = $(ENUM_GENERATED)
 
 EXTRA_DIST = $(noinst_HEADERS)
 
+CLEANFILES = $(BUILT_SOURCES)
+
 -include $(top_srcdir)/git.mk
diff --git a/src/libekolab/kolab-types.h b/src/libekolab/kolab-types.h
index 6976c31..df49201 100644
--- a/src/libekolab/kolab-types.h
+++ b/src/libekolab/kolab-types.h
@@ -37,9 +37,9 @@ typedef enum {
 	KOLAB_TLS_VARIANT_NONE = 0,
 	KOLAB_TLS_VARIANT_SSL,
 	KOLAB_TLS_VARIANT_STARTTLS,
-	KOLAB_TLS_LAST_VARIANT,
-	KOLAB_TLS_FIRST_VARIANT = KOLAB_TLS_VARIANT_NONE,
-	KOLAB_TLS_VARIANT_DEFAULT = KOLAB_TLS_VARIANT_STARTTLS
+	KOLAB_TLS_LAST_VARIANT,                                   /*< skip >*/
+	KOLAB_TLS_FIRST_VARIANT = KOLAB_TLS_VARIANT_NONE,         /*< skip >*/
+	KOLAB_TLS_VARIANT_DEFAULT = KOLAB_TLS_VARIANT_STARTTLS    /*< skip >*/
 } KolabTLSVariantID;
 
 #define KOLAB_TLS_DESC_VARIANT_NONE "No encryption"
@@ -55,9 +55,9 @@ typedef enum {
 	KOLAB_SYNC_STRATEGY_SERVER,	/* always use server data set	*/
 	KOLAB_SYNC_STRATEGY_CLIENT,	/* always use client data set	*/
 	KOLAB_SYNC_STRATEGY_DUPE,	/* create duplicate (new UID)	*/
-	KOLAB_SYNC_LAST_STRATEGY,
-	KOLAB_SYNC_FIRST_STRATEGY = KOLAB_SYNC_STRATEGY_NEWEST,
-	KOLAB_SYNC_STRATEGY_DEFAULT = KOLAB_SYNC_STRATEGY_NEWEST
+	KOLAB_SYNC_LAST_STRATEGY,                                 /*< skip >*/
+	KOLAB_SYNC_FIRST_STRATEGY = KOLAB_SYNC_STRATEGY_NEWEST,   /*< skip >*/
+	KOLAB_SYNC_STRATEGY_DEFAULT = KOLAB_SYNC_STRATEGY_NEWEST  /*< skip >*/
 } KolabSyncStrategyID;
 
 #define KOLAB_STRATEGY_DESC_NEWEST "Take Newer (last modified)"
@@ -70,9 +70,9 @@ typedef enum {
 typedef enum {
 	KOLAB_PKCS11_INFRASTRUCTURE_DISABLE,
 	KOLAB_PKCS11_INFRASTRUCTURE_ENABLE,
-	KOLAB_PKCS11_INFRASTRUCTURE_LAST,
-	KOLAB_PKCS11_INFRASTRUCTURE_FIRST = KOLAB_PKCS11_INFRASTRUCTURE_DISABLE,
-	KOLAB_PKCS11_INFRASTRUCTURE_DEFAULT = KOLAB_PKCS11_INFRASTRUCTURE_DISABLE
+	KOLAB_PKCS11_INFRASTRUCTURE_LAST,                                          /*< skip >*/
+	KOLAB_PKCS11_INFRASTRUCTURE_FIRST = KOLAB_PKCS11_INFRASTRUCTURE_DISABLE,   /*< skip >*/
+	KOLAB_PKCS11_INFRASTRUCTURE_DEFAULT = KOLAB_PKCS11_INFRASTRUCTURE_DISABLE  /*< skip >*/
 } KolabReqPkcs11;
 
 #define KOLAB_REQ_PKCS11_PROP	"kolab-require-pkcs11-infrastructure"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]