static dbus_bool_t
impl_get_nRows (DBusMessageIter * iter, void *user_data)
{
  AtkTable *table = (AtkTable *) user_data;
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
  return droute_return_v_int32 (iter, atk_table_get_n_rows (table));
}
static void
eti_rows_deleted (ETableModel *model,
                  gint row,
                  gint count,
                  AtkObject *table_item)
{
	gint i,j, n_rows, n_cols, old_nrows;
	ETableItem *item = E_TABLE_ITEM (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (table_item)));

	n_rows = atk_table_get_n_rows (ATK_TABLE (table_item));
	n_cols = atk_table_get_n_columns (ATK_TABLE (table_item));

	old_nrows = GET_PRIVATE (table_item)->rows;

	g_return_if_fail (row + count <= old_nrows);
	g_return_if_fail (old_nrows == n_rows + count);
	GET_PRIVATE (table_item)->rows = n_rows;

	g_signal_emit_by_name (
		table_item, "row-deleted", row,
		count, NULL);

	for (i = row; i < (row + count); i++) {
		for (j = 0; j < n_cols; j++) {
			g_signal_emit_by_name (
				table_item,
				"children_changed::remove",
				(((i + 1) * n_cols) + j), NULL, NULL);
		}
	}
	g_signal_emit_by_name (table_item, "visible-data-changed");
	eti_a11y_reset_focus_object ((GalA11yETableItem *) table_item, item, TRUE);
}
int AccessibilityUIElement::rowCount()
{
    if (!ATK_IS_TABLE(m_element.get()))
        return 0;

    return atk_table_get_n_rows(ATK_TABLE(m_element.get()));
}
int AccessibilityUIElement::rowCount()
{
    if (!m_element)
        return 0;

    ASSERT(ATK_IS_TABLE(m_element));

    return atk_table_get_n_rows(ATK_TABLE(m_element));
}
/* Static functions */
static gint
eti_get_n_children (AtkObject *accessible)
{
	g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (accessible), 0);
	if (!eti_a11y_get_gobject (accessible))
		return 0;

	return atk_table_get_n_columns (ATK_TABLE (accessible)) *
		(atk_table_get_n_rows (ATK_TABLE (accessible)) + 1);
}
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 void
eti_rows_inserted (ETableModel *model,
                   gint row,
                   gint count,
                   AtkObject *table_item)
{
	gint n_cols,n_rows,i,j;
	GalA11yETableItem * item_a11y;
	gint old_nrows;

	g_return_if_fail (table_item);
	item_a11y = GAL_A11Y_E_TABLE_ITEM (table_item);

	n_cols = atk_table_get_n_columns (ATK_TABLE (table_item));
	n_rows = atk_table_get_n_rows (ATK_TABLE (table_item));

	old_nrows = GET_PRIVATE (item_a11y)->rows;

	g_return_if_fail (n_cols > 0 && n_rows > 0);
	g_return_if_fail (old_nrows == n_rows - count);

	GET_PRIVATE (table_item)->rows = n_rows;

	g_signal_emit_by_name (
		table_item, "row-inserted", row,
		count, NULL);

	for (i = row; i < (row + count); i++) {
		for (j = 0; j < n_cols; j++) {
			g_signal_emit_by_name (
				table_item,
				"children_changed::add",
				(((i + 1) * n_cols) + j), NULL, NULL);
		}
	}

	g_signal_emit_by_name (table_item, "visible-data-changed");
}
示例#8
0
static VALUE
rg_n_rows(VALUE self)
{
    return INT2NUM(atk_table_get_n_rows(_SELF(self)));
}