gtk2-ng/modules/other/gail/tests/testtablecell.h
Daemonratte 0224e940a0 gail tests: table cells and text boundaries without deprecated calls
ATK 2.12 deprecated the index, row and column calls of AtkTable for
AtkTableCell, and ATK 2.10 the text calls by boundary; gail has neither
replacement, and these tests check its implementations of the old ones.
With such ATK they now ask those implementations directly.
2026-10-19 14:14:52 +02:00

57 lines
1.6 KiB
C

/* Index, row and column of the cells of a table, which the tests check
* in gail.
*
* ATK 2.12 deprecated the calls for them for AtkTableCell, which gail
* does not have; with that ATK the tests ask the implementations the
* calls lead to, before it they keep the calls. */
#ifndef __TEST_TABLE_CELL_H__
#define __TEST_TABLE_CELL_H__
#include <atk/atk.h>
#ifdef ATK_CHECK_VERSION
#if ATK_CHECK_VERSION (2, 12, 0)
#define TEST_TABLE_BY_IFACE 1
#endif
#endif
#ifdef TEST_TABLE_BY_IFACE
static inline gint
test_table_get_index_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface = ATK_TABLE_GET_IFACE (table);
return iface->get_index_at ? iface->get_index_at (table, row, column) : -1;
}
static inline gint
test_table_get_row_at_index (AtkTable *table,
gint index)
{
AtkTableIface *iface = ATK_TABLE_GET_IFACE (table);
return iface->get_row_at_index ? iface->get_row_at_index (table, index) : -1;
}
static inline gint
test_table_get_column_at_index (AtkTable *table,
gint index)
{
AtkTableIface *iface = ATK_TABLE_GET_IFACE (table);
return iface->get_column_at_index ? iface->get_column_at_index (table, index) : -1;
}
#else /* ATK before 2.12 */
#define test_table_get_index_at(table, row, column) atk_table_get_index_at (table, row, column)
#define test_table_get_row_at_index(table, index) atk_table_get_row_at_index (table, index)
#define test_table_get_column_at_index(table, index) atk_table_get_column_at_index (table, index)
#endif
#endif /* __TEST_TABLE_CELL_H__ */