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; }
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row) { if (!ATK_IS_TABLE(m_element.get())) return nullptr; // Adopt the AtkObject representing the cell because // at_table_ref_at() transfers full ownership. GRefPtr<AtkObject> foundCell = adoptGRef(atk_table_ref_at(ATK_TABLE(m_element.get()), row, col)); return foundCell ? AccessibilityUIElement::create(foundCell.get()) : nullptr; }
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row) { if (!m_element) return 0; ASSERT(ATK_IS_TABLE(m_element)); AtkObject* foundCell = atk_table_ref_at(ATK_TABLE(m_element), row, column); return foundCell ? AccessibilityUIElement(foundCell) : 0; }
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row) { if (!m_element) return 0; ASSERT(ATK_IS_TABLE(m_element)); // Adopt the AtkObject representing the cell because // at_table_ref_at() transfers full ownership. GRefPtr<AtkObject> foundCell = adoptGRef(atk_table_ref_at(ATK_TABLE(m_element), row, column)); return foundCell ? AccessibilityUIElement(foundCell.get()) : 0; }
static AtkObject* /* reference */ find_object (GucharmapChartable *chartable, gunichar uc, AtkObject *obj) { GucharmapChartablePrivate *chartable_priv = chartable->priv; gint row, column; row = uc / chartable_priv->cols; column = _gucharmap_chartable_cell_column (chartable, uc); return atk_table_ref_at (ATK_TABLE (obj), row, column); }
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 void _test_gengrid_object(AtkObject *obj) { int child_count = atk_object_get_n_accessible_children(obj); int rows, cols, row_at_index, column_at_index, index_at; gboolean success; AtkTable *table; AtkObject *table_child; for (int i = 0; i < child_count; i++) { AtkObject *child = atk_object_ref_accessible_child(obj, i); _print_object_info(child); g_object_unref(child); } g_assert(ATK_IS_TABLE(obj)); table = ATK_TABLE(obj); rows = atk_table_get_n_rows(table); g_assert(rows == 3); cols = atk_table_get_n_columns(table); g_assert(cols == 3); row_at_index = atk_table_get_row_at_index(table, 4); g_assert(row_at_index == 1); column_at_index = atk_table_get_column_at_index(table, 2); g_assert(column_at_index == 0); index_at = atk_table_get_index_at(table, 2, 2); g_assert(index_at == 8); table_child = atk_table_ref_at(table, 1, 1); g_assert(ATK_IS_OBJECT(table_child)); _print_object_info(table_child); success = atk_table_add_column_selection(table, 1); g_assert(success); success = atk_table_is_column_selected(table, 1); g_assert(success); success = atk_table_remove_column_selection(table, 1); g_assert(success); success = atk_table_add_row_selection(table, 1); g_assert(success); success = atk_table_is_row_selected(table, 1); g_assert(success); success = atk_table_remove_row_selection(table, 0); g_assert(success); }
static VALUE rg_ref_at(VALUE self, VALUE row, VALUE column) { return GOBJ2RVAL(atk_table_ref_at(_SELF(self), NUM2INT(row), NUM2INT(column))); }