-void
-register_subtree (AtkObject *accessible)
-{
- AtkObject *current, *tmp;
- GQueue *stack;
- guint i;
- gboolean recurse;
-
-
- current = g_object_ref (accessible);
- if (has_manages_descendants (current))
- {
- g_object_unref (current);
- return;
- }
-
- stack = g_queue_new ();
-
- register_accessible (current);
- g_queue_push_head (stack, GINT_TO_POINTER (0));
-
- /*
- * The index held on the stack is the next child node
- * that needs processing at the corresponding level in the tree.
- */
- while (!g_queue_is_empty (stack))
- {
- /* Find the next child node that needs processing */
-
- i = GPOINTER_TO_INT(g_queue_peek_head (stack));
- recurse = FALSE;
-
- while (i < atk_object_get_n_accessible_children (current) &&
- recurse == FALSE)
- {
- tmp = atk_object_ref_accessible_child (current, i);
-
- /* TODO Add debug wrapper */
- non_owned_accessible (tmp);
-
- if (object_to_ref (tmp))
- {
- /* If its already registered, just update */
- spi_emit_cache_update (tmp, atk_adaptor_app_data->bus);
- }
- else if (has_manages_descendants (tmp))
- {
- /* If it has manages descendants, just register and update */
- register_accessible (tmp);
- spi_emit_cache_update (tmp, atk_adaptor_app_data->bus);
- }
- else
- {
- recurse = TRUE;
- }
-
- if (!recurse)
- {
- g_object_unref (G_OBJECT (tmp));
- }
-
- i++;
- }
-
- if (recurse)
- {
- /* Push onto stack */
- current = tmp;
- register_accessible (current);
-
- g_queue_peek_head_link (stack)->data = GINT_TO_POINTER (i);
- g_queue_push_head (stack, GINT_TO_POINTER (0));
- }
- else
- {
- /* Pop from stack */
- spi_emit_cache_update (current, atk_adaptor_app_data->bus);
- tmp = current;
- current = atk_object_get_parent (current);
- g_object_unref (G_OBJECT (tmp));
- g_queue_pop_head (stack);
- }
- }
- g_queue_free (stack);
-}
-
-/*---------------------------------------------------------------------------*/
-
-/*
- * Called when an already registered object is updated in such a
- * way that client side cache needs to be updated.
- */
-static void
-update_accessible (AtkObject *accessible)
-{
- guint ref = 0;
- g_assert(ATK_IS_OBJECT(accessible));
-
- ref = object_to_ref (accessible);
- if (ref)
- {
- spi_emit_cache_update (accessible, atk_adaptor_app_data->bus);
- }
-}
-
-/*---------------------------------------------------------------------------*/
-
-void
-atk_dbus_foreach_registered(GHFunc func, gpointer data)
-{
- g_hash_table_foreach(ref2ptr, func, data);
-}
-
-/*
- * Used to lookup an AtkObject from its D-Bus path.
- */
-AtkObject *
-atk_dbus_path_to_object (const char *path)