Commit 4396bbdb authored by Matthias Clasen's avatar Matthias Clasen

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
parent 384393e9
...@@ -730,6 +730,26 @@ gtk_action_muxer_remove (GtkActionMuxer *muxer, ...@@ -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 > /*< private >
* gtk_action_muxer_new: * gtk_action_muxer_new:
* *
...@@ -906,3 +926,4 @@ gtk_print_action_and_target (const gchar *action_namespace, ...@@ -906,3 +926,4 @@ gtk_print_action_and_target (const gchar *action_namespace,
return g_string_free (result, FALSE); return g_string_free (result, FALSE);
} }
...@@ -41,7 +41,9 @@ void gtk_action_muxer_insert (GtkActi ...@@ -41,7 +41,9 @@ void gtk_action_muxer_insert (GtkActi
void gtk_action_muxer_remove (GtkActionMuxer *muxer, void gtk_action_muxer_remove (GtkActionMuxer *muxer,
const gchar *prefix); 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); GtkActionMuxer * gtk_action_muxer_get_parent (GtkActionMuxer *muxer);
void gtk_action_muxer_set_parent (GtkActionMuxer *muxer, void gtk_action_muxer_set_parent (GtkActionMuxer *muxer,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment