#include <stdlib.h>
#include <string.h>
+#include "bridge.h"
#include "accessible.h"
-/* TODO
+/* TODO
* Need to add concurrency support.
*/
static guint counter = 1;
+/* Amazingly the ATK event callbacks dont have a user
+ * data parameter. Instead, with great sadness, we use
+ * some global data. Data is declared and initialized
+ * in bridge.c.
+ */
+extern SpiAppData *atk_adaptor_app_data;
+
/*---------------------------------------------------------------------------*/
/*
{
g_hash_table_remove(ref2ptr, GINT_TO_POINTER(ref));
/* Add to removal list */
- /*
+ /*
* TODO
* Pyatspi client side exceptions have occured indicating
* that an object has been removed twice.
g_hash_table_insert(remove_list, GINT_TO_POINTER(ref), NULL);
}
- atk_tree_cache_needs_update();
+ atk_tree_cache_needs_update(atk_adaptor_app_data->bus);
}
/*---------------------------------------------------------------------------*/
/* Add to update list */
g_hash_table_insert (update_list, GINT_TO_POINTER(reference), accessible);
- atk_tree_cache_needs_update();
+ atk_tree_cache_needs_update(atk_adaptor_app_data->bus);
return reference;
}
{
guint ref;
g_assert(ATK_IS_OBJECT(accessible));
-
+
if (!g_object_get_data (G_OBJECT (accessible), "dbus-id"))
{
register_accessible(accessible);
}
else
{
- ref = g_object_get_data (G_OBJECT (accessible), "dbus-id");
- g_hash_table_insert (update_list, ref, accessible);
- atk_tree_cache_needs_update();
+ ref = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (accessible), "dbus-id"));
+ g_hash_table_insert (update_list, GINT_TO_POINTER (ref), accessible);
+ atk_tree_cache_needs_update(atk_adaptor_app_data->bus);
}
}
index = GPOINTER_TO_INT(g_object_get_data (G_OBJECT (accessible), "dbus-id"));
if (!index)
- index = register_accessible(G_OBJECT(accessible));
+ index = register_accessible(accessible);
return g_strdup_printf(ATK_BRIDGE_OBJECT_REFERENCE_TEMPLATE, index);
}
* Initializes all of the required D-Bus interfaces.
*/
void
-atk_dbus_initialize (DRouteData * data)
+atk_dbus_initialize (AtkObject *root)
{
if (!ref2ptr)
ref2ptr = g_hash_table_new(g_direct_hash, g_direct_equal);
remove_list = g_hash_table_new(g_direct_hash, g_direct_equal);
/* Get the root accessible and add */
- atk_dbus_register_subtree(atk_get_root());
-
- spi_initialize_accessible (data);
- spi_initialize_action(data);
- spi_initialize_collection (data);
- spi_initialize_component (data);
- spi_initialize_document (data);
- spi_initialize_editabletext (data);
- spi_initialize_hyperlink (data);
- spi_initialize_hypertext (data);
- spi_initialize_image (data);
- spi_initialize_selection (data);
- spi_initialize_table (data);
- spi_initialize_text (data);
- spi_initialize_value (data);
- spi_initialize_introspectable(data, (DRouteGetDatumFunction) atk_dbus_get_object);
+ atk_dbus_register_subtree(root);
}
/*END------------------------------------------------------------------------*/