return TRUE;
}
+void
+spi_atk_activate ()
+{
+ DRoutePath *treepath;
+
+ spi_atk_register_event_listeners ();
+ if (!spi_global_cache)
+ {
+ spi_global_cache = g_object_new (SPI_CACHE_TYPE, NULL);
+ treepath = droute_add_one (spi_global_app_data->droute,
+ "/org/a11y/atspi/cache", spi_global_cache);
+
+ if (!treepath)
+ {
+ g_warning ("atk-bridge: Error in droute_add_one(). Already running?");
+ return;
+ }
+ spi_initialize_cache (treepath);
+ }
+}
+
/*
* spi_app_init
*
DBusError error;
AtkObject *root;
gboolean load_bridge;
- DRoutePath *treepath, *accpath;
+ DRoutePath *accpath;
load_bridge = check_envvar ();
if (inited && !load_bridge)
*/
spi_global_register = g_object_new (SPI_REGISTER_TYPE, NULL);
spi_global_leasing = g_object_new (SPI_LEASING_TYPE, NULL);
- spi_global_cache = g_object_new (SPI_CACHE_TYPE, NULL);
/* Register droute for routing AT-SPI messages */
spi_global_app_data->droute =
droute_new ();
- treepath = droute_add_one (spi_global_app_data->droute,
- "/org/a11y/atspi/cache", spi_global_cache);
-
- if (!treepath)
- {
- g_warning ("atk-bridge: Error in droute_add_one(). Already running?");
- return -1;
- }
-
accpath = droute_add_many (spi_global_app_data->droute,
"/org/a11y/atspi/accessible",
NULL,
/* Register all interfaces with droute and set up application accessible db */
- spi_initialize_cache (treepath);
spi_initialize_accessible (accpath);
spi_initialize_application (accpath);
spi_initialize_action (accpath);
/* Register methods to send D-Bus signals on certain ATK events */
if (clients)
- spi_atk_register_event_listeners ();
+ spi_atk_activate ();
/* Set up filter and match rules to catch signals */
dbus_bus_add_match (spi_global_app_data->bus, "type='signal', interface='org.a11y.atspi.Registry', sender='org.a11y.atspi.Registry'", NULL);
return;
}
if (!clients)
- spi_atk_register_event_listeners ();
+ spi_atk_activate ();
clients = g_slist_append (clients, g_strdup (bus_name));
match = g_strdup_printf (name_match_tmpl, bus_name);
dbus_bus_add_match (spi_global_app_data->bus, match, NULL);