+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_if_fail (object != NULL);
+
+ atk_object_set_description (object, descr);
+}
+
+/*
+ * CORBA Accessibility::Accessible::get_parent method implementation
+ */
+static Accessibility_Accessible
+impl_accessibility_accessible_get_parent (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkObject *parent;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, CORBA_OBJECT_NIL);
+
+ parent = atk_object_get_parent (object);
+
+ return spi_accessible_new_return (parent, FALSE, ev);
+}
+
+/*
+ * CORBA Accessibility::Accessible::get_IndexInParent method implementation
+ */
+static CORBA_long
+impl_accessibility_accessible_get_index_in_parent (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, -1);
+
+ return atk_object_get_index_in_parent (object);
+}
+
+/*
+ * CORBA Accessibility::Accessible::get_childCount method implementation
+ */
+static CORBA_long
+impl_accessibility_accessible_get_child_count (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, 0);
+
+ return atk_object_get_n_accessible_children (object);
+}
+
+/*
+ * CORBA Accessibility::Accessible::getChildAtIndex method implementation
+ */
+static Accessibility_Accessible
+impl_accessibility_accessible_get_child_at_index (PortableServer_Servant servant,
+ const CORBA_long index,
+ CORBA_Environment *ev)
+{
+ AtkObject *child;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, CORBA_OBJECT_NIL);
+
+ child = atk_object_ref_accessible_child (object, index);
+
+ return spi_accessible_new_return (child, TRUE, ev);
+}
+
+/*
+ * CORBA Accessibility::Accessible::getState method implementation
+ */
+static Accessibility_StateSet
+impl_accessibility_accessible_get_state (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkObject *object = get_atkobject_from_servant (servant);
+ AtkStateSet *atk_set;
+ SpiStateSet *set;
+ Accessibility_StateSet retval;
+
+ bonobo_return_val_if_fail (object != NULL, NULL, ev);
+
+ atk_set = atk_object_ref_state_set (object);
+
+ set = spi_state_set_new (atk_set);
+ retval = bonobo_object_dup_ref (
+ BONOBO_OBJREF(set),
+ ev);
+
+ return retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::getRelationSet method implementation
+ */
+static Accessibility_RelationSet *
+impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ Accessibility_RelationSet *retval;
+ gint n_relations;
+ gint i;
+ AtkRelationSet *relation_set;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ bonobo_return_val_if_fail (object != NULL, NULL, ev);
+
+ relation_set = atk_object_ref_relation_set (object);
+
+ n_relations = atk_relation_set_get_n_relations (relation_set);
+
+ retval = CORBA_sequence_Accessibility_Relation__alloc ();
+ retval->_length = retval->_maximum = n_relations;
+ retval->_buffer = CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
+ CORBA_sequence_set_release (retval, CORBA_TRUE);
+
+ for (i = 0; i < n_relations; ++i)
+ {
+ retval->_buffer[i] =
+ bonobo_object_dup_ref (
+ BONOBO_OBJREF (
+ spi_relation_new (atk_relation_set_get_relation (relation_set, i))),
+ ev);
+ }
+
+ return retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::getRole method implementation
+ */
+static Accessibility_Role
+impl_accessibility_accessible_get_role (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkRole role;
+ Accessibility_Role retval;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, 0);
+
+ role = atk_object_get_role (object);
+ retval = spi_role_from_atk_role (role);
+
+ return retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::getRole method implementation
+ */
+static CORBA_char *
+impl_accessibility_accessible_get_role_name (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ const gchar *role_name;
+ AtkRole role;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, NULL);
+
+ role = atk_object_get_role (object);
+
+ role_name = atk_role_get_name (role);
+ if (role_name)
+ return CORBA_string_dup (role_name);
+ else
+ return CORBA_string_dup ("");
+}
+
+/*
+ * CORBA Accessibility::Accessible::getLocalizedRole method implementation
+ */
+static CORBA_char *
+impl_accessibility_accessible_get_local_role_name (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ const gchar *role_name;
+ AtkRole role;
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, NULL);
+
+ role = atk_object_get_role (object);
+
+ role_name = atk_role_get_localized_name (role);
+ if (role_name)
+ return CORBA_string_dup (role_name);
+ else
+ return CORBA_string_dup ("");
+}
+
+static Accessibility_Accessible
+impl_accessibility_accessible_get_application (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ return spi_accessible_new_return (atk_get_root (), FALSE, ev);
+}
+
+static Accessibility_AttributeSet*
+impl_accessibility_accessible_get_attributes (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ Accessibility_AttributeSet *retval;
+ GSList *attributes;
+ gint n_attributes = 0;
+ gint i;
+
+ AtkObject *object = get_atkobject_from_servant (servant);
+
+ g_return_val_if_fail (object != NULL, NULL);
+ attributes = atk_object_get_attributes (object);
+
+ bonobo_return_val_if_fail (attributes != NULL, NULL, ev);
+ n_attributes = g_slist_length (attributes);
+
+ retval = CORBA_sequence_CORBA_string__alloc ();
+ retval->_length = retval->_maximum = n_attributes;
+ retval->_buffer = CORBA_sequence_CORBA_string_allocbuf (n_attributes);
+ CORBA_sequence_set_release (retval, CORBA_TRUE);
+
+ for (i = 0; i < n_attributes; ++i)
+ {
+ retval->_buffer[i] = CORBA_string_dup (g_slist_nth_data (attributes, i));
+ }
+
+ return retval;