[gtk/a11y/atspi-action: 17/17] a11y: Add atspi.Action for GtkExpander
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y/atspi-action: 17/17] a11y: Add atspi.Action for GtkExpander
- Date: Thu, 15 Oct 2020 17:46:08 +0000 (UTC)
commit f63754e6fb0e45c2e359af4b09fe7fc40f84847f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Oct 15 16:05:43 2020 +0100
a11y: Add atspi.Action for GtkExpander
gtk/a11y/gtkatspiaction.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
---
diff --git a/gtk/a11y/gtkatspiaction.c b/gtk/a11y/gtkatspiaction.c
index 869903d342..bd5e54c77c 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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]