{
g_return_if_fail (accessible != NULL);
-printf("ref: %p (%d)\n", accessible, accessible->ref_count);fflush(stdout);
accessible->ref_count++;
g_hash_table_insert (live_refs, accessible, accessible);
}
-#define APP_IS_REGISTRY(app) (!strcmp (app->bus_name, "org.freedesktop.atspi.registry"))
+#define APP_IS_REGISTRY(app) (!strcmp (app->bus_name, spi_bus_registry))
static void
cspi_object_unref_internal (Accessible *accessible, gboolean defunct)
return;
}
-printf("unref: %p (%d)\n", accessible, accessible->ref_count - 1);fflush(stdout);
if (--accessible->ref_count == 0 || (accessible->ref_count == 1 && !defunct) && g_hash_table_lookup (live_refs, accessible))
{
AccessibleEvent e;
if (a)
{
cspi_object_ref (a);
-printf("Got %p from %p for %d\n", a, app->hash, id);fflush(stdout);
return a;
}
id_val = g_new (guint, 1);
g_free (id_val);
return NULL;
}
-printf("Inserting %p into %p for %d\n", a, app->hash, *id_val);
g_hash_table_insert (app->hash, id_val, a);
a->app = app;
a->v.id = id;
}
static void
-send_children_change (Accessible *parent, Accessible *child, gboolean add)
+send_children_changed (Accessible *parent, Accessible *child, gboolean add)
{
AccessibleEvent e;
memset (&e, 0, sizeof(e));
- e.type = (add? "object:children-change:add": "object:children-change:remove");
+ e.type = (add? "object:children-changed:add": "object:children-changed:remove");
e.source = parent;
e.detail1 = g_list_index (parent->children, child);
cspi_dispatch_event (&e);
g_warning ("Removing unregistered app %s; doing nothing\n", bus_name);
return FALSE;
}
- send_children_change (a, child, FALSE);
+ send_children_changed (a, child, FALSE);
a->children = g_list_remove (a->children, child);
unref_object_and_children (child);
return TRUE;
gint i;
Accessible *a = g_hash_table_lookup (app->hash, path);
-printf("got %p from %p for %s\n", a, app_hash, path);
if (a)
{
cspi_object_ref (a);
g_free (path_dup);
return NULL;
}
-printf("Inserting %p into %p for %s\n", a, app->hash, path_dup);
g_hash_table_insert (app->hash, path_dup, a);
a->app = app;
a->v.path = path_dup;
CSpiApplication *app = cspi_get_application (sender);
const char *type = cacheSignalType;
-printf("update tree: %p\n", app);
if (!app)
{
g_warning ("UpdateTree from unknown app. Should we add it?", sender);
dbus_error_free (&error);
return DBUS_HANDLER_RESULT_HANDLED;
}
- a = cspi_ref_accessible ("org.freedesktop.atspi.registry", dbus_message_get_path(message));
-printf("Adding %s to %p\n", bus_name, a);
+ a = cspi_ref_accessible (spi_bus_registry, dbus_message_get_path(message));
if (add_app_to_desktop (a, bus_name))
{
- send_children_change (a, g_list_last (a->children)->data, TRUE);
+ send_children_changed (a, g_list_last (a->children)->data, TRUE);
}
cspi_object_unref (a);
return DBUS_HANDLER_RESULT_HANDLED;
dbus_error_free (&error);
return DBUS_HANDLER_RESULT_HANDLED;
}
- a = cspi_ref_accessible ("org.freedesktop.atspi.registry", dbus_message_get_path(message));
-printf("Removing %s from %p\n", bus_name, a);
+ a = cspi_ref_accessible (spi_bus_registry, dbus_message_get_path(message));
remove_app_from_desktop (a, bus_name);
cspi_object_unref (a);
return DBUS_HANDLER_RESULT_HANDLED;
dbus_error_init (&error);
dbus_bus_add_match (bus, match, &error);
g_free (match);
- match = g_strdup_printf ("type='signal',sender='%s'", SPI_DBUS_NAME_REGISTRY);
+ match = g_strdup_printf ("type='signal',sender='%s'", spi_bus_registry);
dbus_bus_add_match (bus, match, &error);
g_free (match);
return 0;