- g_assert(ATK_IS_OBJECT(accessible));
-
- ref = assign_reference();
-
- g_hash_table_insert (ref2ptr, GINT_TO_POINTER(ref), accessible);
- g_object_set_data (G_OBJECT(accessible), "dbus-id", GINT_TO_POINTER(ref));
- g_object_weak_ref(G_OBJECT(accessible), deregister_accessible, NULL);
-}
-
-/*---------------------------------------------------------------------------*/
-
-/*
- * This function checks that the ref-count of an accessible
- * is greater than 1.
- *
- * There is not currently any remote reference counting
- * in AT-SPI D-Bus so objects that are remotely owned are not
- * allowed.
- *
- * TODO Add debug wrapper
- */
-static gboolean
-non_owned_accessible (AtkObject *accessible)
-{
- if ((G_OBJECT (accessible))->ref_count <= 1)
- {
- g_warning ("AT-SPI: Child referenced that is not owned by its parent");
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-/*---------------------------------------------------------------------------*/
-
-static gboolean
-has_manages_descendants (AtkObject *accessible)
-{
- AtkStateSet *state;
- gboolean result = FALSE;
-
- /* This is dangerous, refing the state set
- * seems to do wierd things to the tree & cause recursion
- * by modifying the tree alot.
- */
- state = atk_object_ref_state_set (accessible);
- if (atk_state_set_contains_state (state, ATK_STATE_MANAGES_DESCENDANTS))
- {
- g_warning ("AT-SPI: Object with 'Manages descendants' states not currently handled by AT-SPI");
- result = TRUE;
- }
- g_object_unref (state);
-
- return result;
-}
-
-/*
- * Registers a subtree of accessible objects
- * rooted at the accessible object provided.
- *
- * The leaf nodes do not have their children
- * registered. A node is considered a leaf
- * if it has the state "manages-descendants"
- * or if it has already been registered.
- */
-void
-register_subtree (AtkObject *accessible)
-{
- AtkObject *current, *tmp;
- GQueue *stack;
- guint i;
- gboolean recurse;
-