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
This commit is contained in:
Matthias Clasen 2014-05-13 20:27:58 -04:00
parent 384393e9de
commit 4396bbdb3c
2 changed files with 24 additions and 1 deletions

View File

@ -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);
}

View File

@ -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,