[gtk+/wip/quartzwork: 7/9] GtkMenuTracker: add 'special' items



commit d8b8da4ad34952618078f2c4340de2da196d96f8
Author: Ryan Lortie <desrt desrt ca>
Date:   Sat Dec 14 21:56:26 2013 -0500

    GtkMenuTracker: add 'special' items
    
    Allow the possibility for items to be marked with a special attribute and
    expose this via GtkTrackerMenuItem.  For internal use only.
    
    We will use this to implement the special 'Hide', 'Hide Others' and 'Show All'
    items and the 'Services' submenu in the Mac OS application menu.

 gtk/gtkmenutrackeritem.c |   10 ++++++++++
 gtk/gtkmenutrackeritem.h |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmenutrackeritem.c b/gtk/gtkmenutrackeritem.c
index d220041..0a2ce5b 100644
--- a/gtk/gtkmenutrackeritem.c
+++ b/gtk/gtkmenutrackeritem.c
@@ -575,6 +575,16 @@ gtk_menu_tracker_item_get_accel (GtkMenuTrackerItem *self)
   return gtk_action_muxer_get_primary_accel (GTK_ACTION_MUXER (self->observable), self->action_and_target);
 }
 
+const gchar *
+gtk_menu_tracker_item_get_special (GtkMenuTrackerItem *self)
+{
+  const gchar *special = NULL;;
+
+  g_menu_item_get_attribute (self->item, "gtk-private-special", "&s", &special);
+
+  return special;
+}
+
 GMenuModel *
 _gtk_menu_tracker_item_get_submenu (GtkMenuTrackerItem *self)
 {
diff --git a/gtk/gtkmenutrackeritem.h b/gtk/gtkmenutrackeritem.h
index 9db30eb..2a40a9b 100644
--- a/gtk/gtkmenutrackeritem.h
+++ b/gtk/gtkmenutrackeritem.h
@@ -48,6 +48,8 @@ GtkMenuTrackerItem *   _gtk_menu_tracker_item_new                       (GtkActi
                                                                          const gchar         
*action_namespace,
                                                                          gboolean             is_separator);
 
+const gchar *           gtk_menu_tracker_item_get_special               (GtkMenuTrackerItem *self);
+
 GtkActionObservable *  _gtk_menu_tracker_item_get_observable            (GtkMenuTrackerItem *self);
 
 gboolean                gtk_menu_tracker_item_get_is_separator          (GtkMenuTrackerItem *self);


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