static DBusMessage * impl_getRowAtIndex (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t index; dbus_int32_t row; DBusError error; DBusMessage *reply; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } row = atk_table_get_row_at_index (table, index); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_AddRowSelection (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t row; DBusMessage *reply; dbus_bool_t ret; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } ret = atk_table_add_row_selection (table, row); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_setTextContents (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkEditableText *editable = (AtkEditableText *) user_data; const char *newContents; dbus_bool_t rv; DBusError error; DBusMessage *reply; g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &newContents, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_editable_text_set_text_contents (editable, newContents); rv = TRUE; // TODO decide if we really need this return value reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetRowDescription (DBusConnection * bus, DBusMessage * message, void *user_data) { dbus_int32_t row; AtkTable *table = (AtkTable *) user_data; const gchar *description; DBusMessage *reply; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } description = atk_table_get_row_description (table, row); description = validate_unallocated_string (description); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_STRING, &description, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetAttributeValue (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkDocument *document = (AtkDocument *) user_data; gchar *attributename; const gchar *atr; DBusMessage *reply; g_return_val_if_fail (ATK_IS_DOCUMENT (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &attributename, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atr = atk_document_get_attribute_value (document, attributename); if (!atr) atr = ""; reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_STRING, &atr, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_removeColumnSelection (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t column; DBusError error; DBusMessage *reply; dbus_bool_t ret; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } ret = atk_table_remove_column_selection (table, column); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetColumnAtIndex (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t index; dbus_int32_t column; DBusMessage *reply; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } column = atk_table_get_column_at_index (table, index); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_DoAction (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkAction *action = (AtkAction *) user_data; dbus_int32_t index; dbus_bool_t rv = TRUE; DBusMessage *reply; g_return_val_if_fail (ATK_IS_ACTION (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv, DBUS_TYPE_INVALID); } dbus_connection_send (bus, reply, NULL); dbus_message_unref (reply); atk_action_do_action (action, index); return NULL; }
static DBusMessage * impl_get_localized_name (DBusConnection * bus, DBusMessage * message, void *user_data) { DBusMessage *reply; dbus_int32_t index; const char *name; AtkAction *action = (AtkAction *) user_data; g_return_val_if_fail (ATK_IS_ACTION (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } name = atk_action_get_localized_name (action, index); if (!name) name = ""; reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_insertText (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkEditableText *editable = (AtkEditableText *) user_data; dbus_int32_t position, length; char *text; dbus_bool_t rv; DBusError error; DBusMessage *reply; gint ip; g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &position, DBUS_TYPE_STRING, &text, DBUS_TYPE_INT32, &length, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } ip = position; atk_editable_text_insert_text (editable, text, length, &ip); rv = TRUE; // TODO decide if we really need this return value reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_DeleteText (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkEditableText *editable = (AtkEditableText *) user_data; dbus_int32_t startPos, endPos; DBusError error; dbus_bool_t rv; DBusMessage *reply; g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &startPos, DBUS_TYPE_INT32, &endPos, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_editable_text_delete_text (editable, startPos, endPos); rv = TRUE; // TODO decide if we really need this return value reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetAccessibleAtPoint (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkComponent *component = (AtkComponent *) user_data; dbus_int32_t x, y; dbus_uint32_t coord_type; DBusMessage *reply; DBusError error; AtkObject *child; g_return_val_if_fail (ATK_IS_COMPONENT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } child = atk_component_ref_accessible_at_point (component, x, y, (AtkCoordType) coord_type); reply = spi_object_return_reference (message, child); g_object_unref (child); return reply; }
static DBusMessage * impl_contains (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkComponent *component = (AtkComponent *) user_data; dbus_int32_t x, y; dbus_uint32_t coord_type; DBusError error; dbus_bool_t retval; DBusMessage *reply; g_return_val_if_fail (ATK_IS_COMPONENT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } retval = atk_component_contains (component, x, y, (AtkCoordType) coord_type); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetPosition (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkComponent *component = (AtkComponent *) user_data; DBusError error; dbus_uint32_t coord_type; gint ix = 0, iy = 0; dbus_int32_t x, y; DBusMessage *reply; g_return_val_if_fail (ATK_IS_COMPONENT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_component_get_position (component, &ix, &iy, (AtkCoordType) coord_type); x = ix; y = iy; reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_getColumnDescription (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t column; const char *description; DBusError error; DBusMessage *reply; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } description = atk_table_get_column_description (table, column); if (!description) description = ""; reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_STRING, &description, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_Embedded (DBusConnection *bus, DBusMessage *message, void *user_data) { AtkObject *object = (AtkObject *) user_data; char *path; gchar *id; if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } id = g_strconcat (dbus_message_get_sender (message), ":", path, NULL); g_object_set_data_full (G_OBJECT (object), "dbus-plug-parent", id, (GDestroyNotify)g_free); if (ATK_IS_COMPONENT (object)) { AtkComponent *component = ATK_COMPONENT (object); AtkComponentIface *iface = ATK_COMPONENT_GET_IFACE (component); iface->get_extents = atspi_plug_component_get_extents; iface->get_size = atspi_plug_component_get_size; iface->get_position = atspi_plug_component_get_position; } /* Retrieve some info about the children, if they exist, when embedding the plug to ensure the a11y subtree is generated. https://bugzilla.gnome.org/show_bug.cgi?id=663876 */ atk_object_get_n_accessible_children (object); return dbus_message_new_method_return (message); }
static DBusMessage * impl_getColumnExtentAt (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t row, column; dbus_int32_t extent; DBusError error; DBusMessage *reply; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } extent = atk_table_get_column_extent_at (table, row, column); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_INT32, &extent, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_GetAccessibleAt (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t row, column; DBusMessage *reply; DBusError error; AtkObject *obj; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } obj = atk_table_ref_at (table, row, column); reply = spi_object_return_reference (message, obj); g_object_unref (obj); return reply; }
static DBusMessage * impl_GetChildAtIndex (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkObject *object = (AtkObject *) user_data; DBusMessage *reply; dbus_int32_t i; AtkObject *child; g_return_val_if_fail (ATK_IS_OBJECT (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } if (ATK_IS_SOCKET (object) && atk_socket_is_occupied (ATK_SOCKET (object)) && i == 0) { AtkSocket *socket = ATK_SOCKET (object); gchar *child_name, *child_path; child_name = g_strdup (socket->embedded_plug_id); child_path = g_utf8_strchr (child_name + 1, -1, ':'); if (child_path) { DBusMessageIter iter, iter_socket; *(child_path++) = '\0'; reply = dbus_message_new_method_return (message); if (!reply) return NULL; dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_STRUCT, NULL, &iter_socket); dbus_message_iter_append_basic (&iter_socket, DBUS_TYPE_STRING, &child_name); dbus_message_iter_append_basic (&iter_socket, DBUS_TYPE_OBJECT_PATH, &child_path); dbus_message_iter_close_container (&iter, &iter_socket); return reply; } g_free (child_name); } child = atk_object_ref_accessible_child (object, i); reply = spi_object_return_reference (message, child); if (child) g_object_unref (child); return reply; }
static DBusMessage * impl_GetColumnHeader (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t column; AtkObject *obj; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } obj = atk_table_get_column_header (table, column); return spi_object_return_reference (message, obj); }
static DBusMessage * impl_GetRowColumnExtentsAtIndex (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t index; dbus_int32_t row, column, row_extents, col_extents; dbus_bool_t is_selected; dbus_bool_t ret; DBusMessage *reply; AtkObject *cell; AtkRole role = ATK_ROLE_INVALID; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } column = atk_table_get_column_at_index (table, index); row = atk_table_get_row_at_index (table, index); row_extents = atk_table_get_row_extent_at (table, row, column); col_extents = atk_table_get_column_extent_at (table, row, column); is_selected = atk_table_is_selected (table, row, column); cell = atk_table_ref_at (table, row, column); if (cell) { role = atk_object_get_role (cell); g_object_unref (cell); } ret = (role == ATK_ROLE_TABLE_CELL ? TRUE : FALSE); reply = dbus_message_new_method_return (message); if (reply) { dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column, DBUS_TYPE_INT32, &row_extents, DBUS_TYPE_INT32, &col_extents, DBUS_TYPE_BOOLEAN, &is_selected, DBUS_TYPE_INVALID); } return reply; }
static DBusMessage * impl_copyText (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkEditableText *editable = (AtkEditableText *) user_data; dbus_int32_t startPos, endPos; DBusError error; g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &startPos, DBUS_TYPE_INT32, &endPos, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_editable_text_copy_text (editable, startPos, endPos); return dbus_message_new_method_return (message); }
static DBusMessage * impl_getRowHeader (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkTable *table = (AtkTable *) user_data; dbus_int32_t row; DBusError error; AtkObject *obj; g_return_val_if_fail (ATK_IS_TABLE (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } obj = atk_table_get_row_header (table, row); return spi_dbus_return_object (message, obj, FALSE); }
static DBusMessage * impl_GetExtents (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkComponent *component = (AtkComponent *) user_data; DBusError error; dbus_uint32_t coord_type; gint ix, iy, iwidth, iheight; g_return_val_if_fail (ATK_IS_COMPONENT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_component_get_extents (component, &ix, &iy, &iwidth, &iheight, (AtkCoordType) coord_type); return spi_dbus_return_rect (message, ix, iy, iwidth, iheight); }