[gtk/matthiasc/a11y: 4/12] Add a GetInterfaces method




commit 8173fb7a089491085abe6ccf38d74a837a4571c9
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 9 23:32:36 2020 -0400

    Add a GetInterfaces method
    
    It turns out that accerciser depends on this undocumented
    method that is not in the xml at all, otherwise interface
    sections in the accerciser ui never get enabled.

 gtk/a11y/atspi/Accessible.xml |  4 ++++
 gtk/a11y/gtkatspicontext.c    | 10 ++++++++++
 gtk/a11y/gtkatspiroot.c       |  8 ++++++++
 3 files changed, 22 insertions(+)
---
diff --git a/gtk/a11y/atspi/Accessible.xml b/gtk/a11y/atspi/Accessible.xml
index 7015466060..a274cdb902 100644
--- a/gtk/a11y/atspi/Accessible.xml
+++ b/gtk/a11y/atspi/Accessible.xml
@@ -63,5 +63,9 @@
     <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QSpiObjectReference"/>
   </method>
 
+  <method name="GetInterfaces">
+    <arg direction="out" type="as"/>
+  </method>
+
 </interface>
 </node>
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index 1567a665d2..0960962a9a 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -28,6 +28,7 @@
 #include "gtkatspiutilsprivate.h"
 
 #include "a11y/atspi/atspi-accessible.h"
+#include "a11y/atspi/atspi-text.h"
 
 #include "gtkdebug.h"
 #include "gtkwindow.h"
@@ -371,6 +372,15 @@ handle_accessible_method (GDBusConnection       *connection,
 
       g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", idx));
     }
+  else if (g_strcmp0 (method_name, "GetInterfaces") == 0)
+    {
+      GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
+      GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("as"));
+
+      g_variant_builder_add (&builder, "s", "org.a11y.atspi.Accessible");
+      g_dbus_method_invocation_return_value (invocation, g_variant_new ("(as)", &builder));
+    }
+
 }
 
 static GVariant *
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index 9d93de27f9..5e74bf6d46 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -331,6 +331,14 @@ handle_accessible_method (GDBusConnection       *connection,
     {
       g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", -1));
     }
+  else if (g_strcmp0 (method_name, "GetInterfaces") == 0)
+    {
+      GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("as"));
+
+      g_variant_builder_add (&builder, "s", "org.a11y.atspi.Accessible");
+      g_variant_builder_add (&builder, "s", "org.a11y.atspi.Application");
+      g_dbus_method_invocation_return_value (invocation, g_variant_new ("(as)", &builder));
+    }
 }
 
 static GVariant *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]