a11y: Add method to extract desktop data

We are going to need the desktop name and path to populate the parent
property of AtSpiContexts associated to top level widgets.
This commit is contained in:
Emmanuele Bassi
2020-10-09 22:38:08 +01:00
parent 468317fef2
commit 7661759acd
2 changed files with 19 additions and 2 deletions

View File

@@ -209,8 +209,7 @@ handle_accessible_method (GDBusConnection *connection,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
g_printerr ("[Accessible] Method '%s' on interface '%s' for object '%s' from '%s'\n",
method_name, interface_name, object_path, sender);
GtkAtSpiRoot *self = user_data;
if (g_strcmp0 (method_name, "GetRole") == 0)
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(u)", ATSPI_ROLE_APPLICATION));
@@ -455,3 +454,16 @@ gtk_at_spi_root_get_cache (GtkAtSpiRoot *self)
return self->cache;
}
void
gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
const char **name,
const char **path)
{
g_return_if_fail (GTK_IS_AT_SPI_ROOT (self));
if (name != NULL)
*name = self->desktop_name;
if (path != NULL)
*path = self->desktop_path;
}

View File

@@ -39,4 +39,9 @@ gtk_at_spi_root_get_connection (GtkAtSpiRoot *self);
GtkAtSpiCache *
gtk_at_spi_root_get_cache (GtkAtSpiRoot *self);
void
gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
const char **name,
const char **path);
G_END_DECLS