summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-05-13 20:27:58 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-05-14 21:27:56 -0400
commit4396bbdb3c040c1f5bfc8dd24b7b5092d4cf73b4 (patch)
treec28fbfea07e23aaee9620d05d7070ef7cec241e5
parent384393e9de1b5f88f16a6920a744f367b374c092 (diff)
downloadgtk+-4396bbdb3c040c1f5bfc8dd24b7b5092d4cf73b4.tar.gz
GtkActionMuxer: Add getters
Add a way to enumerate all prefixes, and to get the action group for a prefix. https://bugzilla.gnome.org/show_bug.cgi?id=730095
-rw-r--r--gtk/gtkactionmuxer.c21
-rw-r--r--gtk/gtkactionmuxer.h4
2 files changed, 24 insertions, 1 deletions
diff --git a/gtk/gtkactionmuxer.c b/gtk/gtkactionmuxer.c
index 2e48d6c28b..09cb1b3741 100644
--- a/gtk/gtkactionmuxer.c
+++ b/gtk/gtkactionmuxer.c
@@ -730,6 +730,26 @@ gtk_action_muxer_remove (GtkActionMuxer *muxer,
}
}
+gchar **
+gtk_action_muxer_list_prefixes (GtkActionMuxer *muxer)
+{
+ return (gchar **) g_hash_table_get_keys_as_array (muxer->groups, NULL);
+}
+
+GActionGroup *
+gtk_action_muxer_lookup (GtkActionMuxer *muxer,
+ const gchar *prefix)
+{
+ Group *group;
+
+ group = g_hash_table_lookup (muxer->groups, prefix);
+
+ if (group != NULL)
+ return group->group;
+
+ return NULL;
+}
+
/*< private >
* gtk_action_muxer_new:
*
@@ -906,3 +926,4 @@ gtk_print_action_and_target (const gchar *action_namespace,
return g_string_free (result, FALSE);
}
+
diff --git a/gtk/gtkactionmuxer.h b/gtk/gtkactionmuxer.h
index d71abf48dd..94b7491409 100644
--- a/gtk/gtkactionmuxer.h
+++ b/gtk/gtkactionmuxer.h
@@ -41,7 +41,9 @@ void gtk_action_muxer_insert (GtkActi
void gtk_action_muxer_remove (GtkActionMuxer *muxer,
const gchar *prefix);
-
+gchar ** gtk_action_muxer_list_prefixes (GtkActionMuxer *muxer);
+GActionGroup * gtk_action_muxer_lookup (GtkActionMuxer *muxer,
+ const gchar *prefix);
GtkActionMuxer * gtk_action_muxer_get_parent (GtkActionMuxer *muxer);
void gtk_action_muxer_set_parent (GtkActionMuxer *muxer,