muxer: add helper to get group by name

This is useful when you need to read a group back out of the muxer.
This commit is contained in:
Christian Hergert 2020-12-02 19:41:16 -08:00
parent 92f0216605
commit b68e0bb3fb
2 changed files with 15 additions and 0 deletions

View File

@ -315,6 +315,19 @@ gtk_action_muxer_find (GtkActionMuxer *muxer,
return NULL;
}
GActionGroup *
gtk_action_muxer_get_group (GtkActionMuxer *muxer,
const char *group_name)
{
Group *group;
group = g_hash_table_lookup (muxer->groups, group_name);
if (group)
return group->group;
return NULL;
}
static inline Action *
find_observers (GtkActionMuxer *muxer,
const char *action_name)

View File

@ -60,6 +60,8 @@ void gtk_action_muxer_remove (GtkActi
GActionGroup * gtk_action_muxer_find (GtkActionMuxer *muxer,
const char *action_name,
const char **unprefixed_name);
GActionGroup * gtk_action_muxer_get_group (GtkActionMuxer *muxer,
const char *group_name);
GtkActionMuxer * gtk_action_muxer_get_parent (GtkActionMuxer *muxer);
void gtk_action_muxer_set_parent (GtkActionMuxer *muxer,