diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-10-15 16:05:43 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-10-16 00:34:01 +0100 |
commit | 9ae08fc0f061625221d7d148107b39f26404363b (patch) | |
tree | b30637ea81dcff9e63a05c610ebc33b973031f22 | |
parent | 5f1128899c5913b8ff6070ee0ef06007ca0c8944 (diff) | |
download | gtk+-9ae08fc0f061625221d7d148107b39f26404363b.tar.gz |
a11y: Add atspi.Action for GtkExpander
-rw-r--r-- | gtk/a11y/gtkatspiaction.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gtk/a11y/gtkatspiaction.c b/gtk/a11y/gtkatspiaction.c index c25b0d2c34..08601e7672 100644 --- a/gtk/a11y/gtkatspiaction.c +++ b/gtk/a11y/gtkatspiaction.c @@ -30,6 +30,7 @@ #include "gtkactionable.h" #include "gtkactionmuxerprivate.h" #include "gtkbutton.h" +#include "gtkexpander.h" #include "gtkswitch.h" #include "gtkwidgetprivate.h" @@ -296,6 +297,58 @@ static const GDBusInterfaceVTable switch_action_vtable = { /* }}} */ +/* {{{ GtkExpander */ + +static const Action expander_actions[] = { + { + .name = "activate", + .localized_name = NC_("accessibility", "Activate"), + .description = NC_("accessibility", "Activates the expander"), + .keybinding = "<Space>", + }, +}; + +static void +expander_handle_method (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GtkAtSpiContext *self = user_data; + + action_handle_method (self, method_name, parameters, invocation, + expander_actions, + G_N_ELEMENTS (expander_actions)); +} + +static GVariant * +expander_handle_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GtkAtSpiContext *self = user_data; + + return action_handle_get_property (self, property_name, error, + expander_actions, + G_N_ELEMENTS (expander_actions)); +} + +static const GDBusInterfaceVTable expander_action_vtable = { + expander_handle_method, + expander_handle_get_property, + NULL, +}; + +/* }}} */ + static gboolean is_valid_action (GtkActionMuxer *muxer, const char *action_name) @@ -509,6 +562,8 @@ gtk_atspi_get_action_vtable (GtkAccessible *accessible) { if (GTK_IS_BUTTON (accessible)) return &button_action_vtable; + else if (GTK_IS_EXPANDER (accessible)) + return &expander_action_vtable; else if (GTK_IS_SWITCH (accessible)) return &switch_action_vtable; else if (GTK_IS_WIDGET (accessible)) |