[gtk/matthiasc/a11y] atspiroot: Implement more of the Accessible api




commit ad07680c22cb999c5c6ecdc96ceaa8fec4221315
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 9 15:59:29 2020 -0400

    atspiroot: Implement more of the Accessible api
    
    Implement GetIndexInParent, GetAttributes and GetRelationSet.
    All of these return nothing for the root object.
    
    And implement GetApplication, returning the root object itself.

 gtk/a11y/gtkatspiroot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index 60c674d89a..51ed9acc0f 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -230,6 +230,8 @@ handle_accessible_method (GDBusConnection       *connection,
                           GDBusMethodInvocation *invocation,
                           gpointer               user_data)
 {
+  GtkAtSpiRoot *self = user_data;
+
   g_printerr ("[Accessible] Method '%s' on interface '%s' for object '%s' from '%s'\n",
               method_name, interface_name, object_path, sender);
 
@@ -239,6 +241,19 @@ handle_accessible_method (GDBusConnection       *connection,
     g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "application"));
   else if (g_strcmp0 (method_name, "GetLocalizedRoleName") == 0)
     g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "application"));
+  else if (g_strcmp0 (method_name, "GetIndexInParent") == 0)
+    g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", -1));
+  else if (g_strcmp0 (method_name, "GetAttributes") == 0)
+    g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss})", NULL));
+  else if (g_strcmp0 (method_name, "GetRelationSet") == 0)
+    g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a(ua(so)))", NULL));
+  else if (g_strcmp0 (method_name, "GetApplication") == 0)
+    {
+      const char *unique_name;
+
+      unique_name = g_dbus_connection_get_unique_name (connection);
+      g_dbus_method_invocation_return_value (invocation, g_variant_new ("((so))", unique_name, 
self->root_path));
+    }
 }
 
 static GVariant *


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