[gnome-menus/wip/gobject-rebase2: 1/13] GMenuTreeFlags: Register with GType



commit 6ad3f7a686225c6e576a482d9c59b4cf3f4e2716
Author: Colin Walters <walters verbum org>
Date:   Sun Apr 17 07:17:22 2011 -0400

    GMenuTreeFlags: Register with GType
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647968

 libmenu/gmenu-tree.c |   20 ++++++++++++++++++++
 libmenu/gmenu-tree.h |    2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
index 5689bd4..53d89fb 100644
--- a/libmenu/gmenu-tree.c
+++ b/libmenu/gmenu-tree.c
@@ -4437,3 +4437,23 @@ gmenu_tree_force_rebuild (GMenuTree *tree)
                                                     tree);
     }
 }
+
+GType
+gmenu_tree_flags_get_type (void)
+{
+  static GType enum_type_id = 0;
+  if (G_UNLIKELY (!enum_type_id))
+    {
+      static const GFlagsValue values[] = {
+        { GMENU_TREE_FLAGS_NONE, "GMENU_TREE_FLAGS_NONE", "none" },
+        { GMENU_TREE_FLAGS_INCLUDE_EXCLUDED, "GMENU_TREE_FLAGS_INCLUDE_EXCLUDED", "include-excluded" },
+        { GMENU_TREE_FLAGS_SHOW_EMPTY, "GMENU_TREE_FLAGS_SHOW_EMPTY", "show-empty" },
+        { GMENU_TREE_FLAGS_INCLUDE_NODISPLAY, "GMENU_TREE_FLAGS_INCLUDE_NODISPLAY", "include-nodisplay" },
+        { GMENU_TREE_FLAGS_SHOW_ALL_SEPARATORS, "GMENU_TREE_FLAGS_SHOW_ALL_SEPARATORS", "show-all-separators" },
+        { GMENU_TREE_FLAGS_SORT_DISPLAY_NAME, "GMENU_TREE_FLAGS_SORT_DISPLAY_NAME", "sort-display-name" },
+        { 0, NULL, NULL }
+      };
+      enum_type_id = g_flags_register_static ("GMenuTreeFlags", values);
+    }
+  return enum_type_id;
+}
diff --git a/libmenu/gmenu-tree.h b/libmenu/gmenu-tree.h
index d1fcdef..177f710 100644
--- a/libmenu/gmenu-tree.h
+++ b/libmenu/gmenu-tree.h
@@ -65,6 +65,8 @@ typedef enum
   GMENU_TREE_FLAGS_SHOW_ALL_SEPARATORS = 1 << 3,
   GMENU_TREE_FLAGS_SORT_DISPLAY_NAME   = 1 << 4
 } GMenuTreeFlags;
+GType gmenu_tree_flags_get_type (void);
+#define GMENU_TYPE_TREE_FLAGS (gmenu_tree_flags_get_type ())
 
 GMenuTree *gmenu_tree_lookup (const char     *menu_file,
 			      GMenuTreeFlags  flags);



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