diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-15 16:18:36 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-15 16:32:55 -0400 |
commit | 4bd2595421d8629dad2ed66d4656c3a62156bb29 (patch) | |
tree | 57d4e262ddf7e807ce7f740fee78a1f4d027ffe2 /gtk | |
parent | aa4c0bf272f85df03297cc6f12bf5e5a6fe3db48 (diff) | |
download | gtk+-4bd2595421d8629dad2ed66d4656c3a62156bb29.tar.gz |
actionmuxer: Make it possible to enumerate local actions
This will be useful for exposing actions via the
AT-SPI Actions interface.
Update all callers.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkactionmuxer.c | 6 | ||||
-rw-r--r-- | gtk/gtkactionmuxerprivate.h | 3 | ||||
-rw-r--r-- | gtk/inspector/actions.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkactionmuxer.c b/gtk/gtkactionmuxer.c index d10b813a0f..ed9ee26b85 100644 --- a/gtk/gtkactionmuxer.c +++ b/gtk/gtkactionmuxer.c @@ -224,7 +224,8 @@ gtk_action_muxer_append_group_actions (const char *prefix, } char ** -gtk_action_muxer_list_actions (GtkActionMuxer *muxer) +gtk_action_muxer_list_actions (GtkActionMuxer *muxer, + gboolean local_only) { GHashTable *actions; char **keys; @@ -253,6 +254,9 @@ gtk_action_muxer_list_actions (GtkActionMuxer *muxer) while (g_hash_table_iter_next (&iter, (gpointer *)&prefix, (gpointer *)&group)) gtk_action_muxer_append_group_actions (prefix, group, actions); } + + if (local_only) + break; } keys = (char **)g_hash_table_get_keys_as_array (actions, NULL); diff --git a/gtk/gtkactionmuxerprivate.h b/gtk/gtkactionmuxerprivate.h index cd1786b2c3..63a8f51c6c 100644 --- a/gtk/gtkactionmuxerprivate.h +++ b/gtk/gtkactionmuxerprivate.h @@ -81,7 +81,8 @@ void gtk_action_muxer_change_action_state (GtkActi GVariant *state); gboolean gtk_action_muxer_has_action (GtkActionMuxer *muxer, const char *action_name); -char ** gtk_action_muxer_list_actions (GtkActionMuxer *muxer); +char ** gtk_action_muxer_list_actions (GtkActionMuxer *muxer, + gboolean local_only); /* api for class actions */ void gtk_action_muxer_action_enabled_changed (GtkActionMuxer *muxer, diff --git a/gtk/inspector/actions.c b/gtk/inspector/actions.c index d3797a0b2d..9c01e7475b 100644 --- a/gtk/inspector/actions.c +++ b/gtk/inspector/actions.c @@ -275,7 +275,7 @@ add_muxer (GtkInspectorActions *sl, int i; char **names; - names = gtk_action_muxer_list_actions (muxer); + names = gtk_action_muxer_list_actions (muxer, FALSE); for (i = 0; names[i]; i++) action_added (G_OBJECT (muxer), names[i], sl); g_strfreev (names); |