return return_value;
}
+/**
+ * atspi_accessible_get_reading_material:
+ * @obj: a pointer to the #AtspiAccessible object on which to operate.
+ *
+ * Gets reading material
+ *
+ * Returns: reading material to be used screen-reader side. This is not stable.
+ * You have to handle all alocated memory as below on screen-reader side.
+ *
+ * AtspiAccessibleReadingMaterial *rm
+ * g_object_unref(rm->parent);
+ * g_object_unref(rm->described_by_accessible);
+ * g_hash_table_unref(rm->attributes);
+ * free(rm->name);
+ * free(rm->labeled_by_name);
+ * free(rm->text_interface_name);
+ * free(rm->localized_role_name);
+ * free(rm->description);
+ * free(rm);
+ **/
+AtspiAccessibleReadingMaterial *
+atspi_accessible_get_reading_material (AtspiAccessible *obj, GError **error)
+{
+ AtspiAccessible *parent;
+ AtspiAccessibleReadingMaterial *reading_material = NULL;
+ const char *name;
+ double current_value;
+ gint count;
+ guint64 val;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter iter_array;
+ dbus_uint32_t role;
+ dbus_uint32_t *states;
+ dbus_int32_t index_in_parent;
+ dbus_int32_t child_count;
+ dbus_bool_t is_selected;
+
+ g_return_val_if_fail (obj != NULL, NULL);
+
+ reply = _atspi_dbus_call_partial (obj, atspi_interface_accessible, "GetReadingMaterial", error, "");
+
+ _ATSPI_DBUS_CHECK_SIG (reply, "a{ss}sssuausiddddsibbii(so)auiui(so)", NULL, NULL);
+
+ reading_material = calloc(1, sizeof(AtspiAccessibleReadingMaterial));
+ if (!reading_material)
+ {
+ return reading_material;
+ }
+
+ dbus_message_iter_init (reply, &iter);
+
+ /* get attributes */
+ reading_material->attributes = _atspi_dbus_hash_from_iter (&iter);
+ dbus_message_iter_next (&iter);
+
+ /* get name */
+ dbus_message_iter_get_basic (&iter, &name);
+ reading_material->name = g_strdup (name);
+ dbus_message_iter_next (&iter);
+
+ /* get name of relation LABELED_BY */
+ dbus_message_iter_get_basic (&iter, &name);
+ reading_material->labeled_by_name = g_strdup (name);
+ dbus_message_iter_next (&iter);
+
+ /* get name of text interface */
+ dbus_message_iter_get_basic (&iter, &name);
+ reading_material->text_interface_name = g_strdup (name);
+ dbus_message_iter_next (&iter);
+
+ /* get role */
+ dbus_message_iter_get_basic (&iter, &role);
+ reading_material->role = role;
+ dbus_message_iter_next (&iter);
+
+ /* get state set */
+ dbus_message_iter_recurse (&iter, &iter_array);
+ dbus_message_iter_get_fixed_array (&iter_array, &states, &count);
+ val = ((guint64)states [1]) << 32;
+ val += states [0];
+ reading_material->states = val;
+ dbus_message_iter_next (&iter);
+
+ /* get localized role name */
+ dbus_message_iter_get_basic (&iter, &name);
+ reading_material->localized_role_name = g_strdup (name);
+ dbus_message_iter_next (&iter);
+
+ /* get child count */
+ dbus_message_iter_get_basic (&iter, &child_count);
+ reading_material->child_count = child_count;
+ dbus_message_iter_next (&iter);
+
+ /* get current value */
+ dbus_message_iter_get_basic (&iter, ¤t_value);
+ reading_material->value = current_value;
+ dbus_message_iter_next (&iter);
+
+ /* get minimum increment */
+ dbus_message_iter_get_basic (&iter, ¤t_value);
+ reading_material->increment = current_value;
+ dbus_message_iter_next (&iter);
+
+ /* get maximum value */
+ dbus_message_iter_get_basic (&iter, ¤t_value);
+ reading_material->upper = current_value;
+ dbus_message_iter_next (&iter);
+
+ /* get minimum value */
+ dbus_message_iter_get_basic (&iter, ¤t_value);
+ reading_material->lower = current_value;
+ dbus_message_iter_next (&iter);
+
+ /* get description */
+ dbus_message_iter_get_basic (&iter, &name);
+ reading_material->description = g_strdup (name);
+ dbus_message_iter_next (&iter);
+
+ /* get index in parent */
+ dbus_message_iter_get_basic (&iter, &index_in_parent);
+ reading_material->index_in_parent = index_in_parent;
+ dbus_message_iter_next (&iter);
+
+ /* get selected in parent */
+ dbus_message_iter_get_basic (&iter, &is_selected);
+ reading_material->is_selected_in_parent = is_selected;
+ dbus_message_iter_next (&iter);
+
+ /* get has checkbox child */
+ dbus_message_iter_get_basic (&iter, &is_selected);
+ reading_material->has_checkbox_child = is_selected;
+ dbus_message_iter_next (&iter);
+
+ /* get list children count */
+ dbus_message_iter_get_basic (&iter, &child_count);
+ reading_material->list_children_count = child_count;
+ dbus_message_iter_next (&iter);
+
+ /* get first selected child index */
+ dbus_message_iter_get_basic (&iter, &index_in_parent);
+ reading_material->first_selected_child_index = index_in_parent;
+ dbus_message_iter_next (&iter);
+
+ ////////////////
+ /* get parent */
+ parent = _atspi_dbus_return_accessible_from_iter (&iter);
+ reading_material->parent = parent;
+
+ /* parent states */
+ dbus_message_iter_recurse (&iter, &iter_array);
+ dbus_message_iter_get_fixed_array (&iter_array, &states, &count);
+ val = ((guint64)states [1]) << 32;
+ val += states [0];
+ reading_material->parent_states = val;
+ dbus_message_iter_next (&iter);
+
+ /* get parent child count */
+ dbus_message_iter_get_basic (&iter, &child_count);
+ reading_material->parent_child_count = child_count;
+ dbus_message_iter_next (&iter);
+
+ /* get parent role */
+ dbus_message_iter_get_basic (&iter, &role);
+ reading_material->parent_role = role;
+ dbus_message_iter_next (&iter);
+
+ /* get parent selected child count */
+ dbus_message_iter_get_basic (&iter, &child_count);
+ reading_material->parent_selected_child_count = child_count;
+ dbus_message_iter_next (&iter);
+
+ ////////////////////////////////////////
+ /* get relation object - DESCRIBED_BY */
+ parent = _atspi_dbus_return_accessible_from_iter (&iter);
+ reading_material->described_by_accessible = parent;
+
+ return reading_material;
+}
+
static unsigned char are_objects_on_the_same_bus(AtspiAccessible *obj1, AtspiAccessible *obj2)
{
const char *bus_name_1 = obj1->parent.app->bus_name;