From 8665558111a7e4bc439818a8fc1c34c81bac7da4 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 3 Jan 2005 18:30:35 +0000 Subject: Add type for flags. 2005-01-03 Christian Persch * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_flags_get_type): * lib/egg/egg-toolbars-model.h: Add type for flags. --- lib/egg/egg-toolbars-model.c | 24 ++++++++++++++++++++++++ lib/egg/egg-toolbars-model.h | 3 +++ 2 files changed, 27 insertions(+) (limited to 'lib/egg') diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index c4c30880f..0b4bc93ff 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -70,6 +70,30 @@ struct EggToolbarsModelPrivate GNode *toolbars; }; +GType +egg_toolbars_model_flags_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + { + static const GFlagsValue values[] = + { + { EGG_TB_MODEL_NOT_REMOVABLE, "EGG_TB_MODEL_NOT_REMOVABLE", "not-removable" }, + { EGG_TB_MODEL_ICONS_ONLY, "EGG_TB_MODEL_ICONS_ONLY", "icons-only" }, + { EGG_TB_MODEL_TEXT_ONLY, "EGG_TB_MODEL_TEXT_ONLY", "text-only" }, + { EGG_TB_MODEL_ICONS_TEXT, "EGG_TB_MODEL_ICONS_TEXT", "text" }, + { EGG_TB_MODEL_ICONS_TEXT_HORIZ, "EGG_TB_MODEL_ICONS_TEXT_HORIZ", "text-horiz" }, + { EGG_TB_MODEL_ACCEPT_ITEMS_ONLY, "EGG_TB_MODEL_ACCEPT_ITEMS_ONLY", "accept-items-only" }, + { 0, NULL, NULL } + }; + + type = g_flags_register_static ("EggToolbarsModelFlags", values); + } + +return type; +} + GType egg_toolbars_model_get_type (void) { diff --git a/lib/egg/egg-toolbars-model.h b/lib/egg/egg-toolbars-model.h index 0ea3c55d4..551f46edb 100755 --- a/lib/egg/egg-toolbars-model.h +++ b/lib/egg/egg-toolbars-model.h @@ -34,6 +34,8 @@ G_BEGIN_DECLS #define EGG_IS_TOOLBARS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TOOLBARS_MODEL)) #define EGG_TOOLBARS_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelClass)) +#define EGG_TYPE_TOOLBARS_MODEL_FLAGS (egg_toolbars_model_flags_get_type ()) + typedef struct EggToolbarsModel EggToolbarsModel; typedef struct EggToolbarsModelPrivate EggToolbarsModelPrivate; typedef struct EggToolbarsModelClass EggToolbarsModelClass; @@ -92,6 +94,7 @@ struct EggToolbarsModelClass const char *type); }; +GType egg_toolbars_model_flags_get_type (void); GType egg_toolbars_model_get_type (void); EggToolbarsModel *egg_toolbars_model_new (void); gboolean egg_toolbars_model_load (EggToolbarsModel *model, -- cgit v1.2.3