1 /* This file contains both declaration and definition of the TestSimpleTable,
2 * a GObject that pretends to implement the AtkTableIface interface (it
3 * registers appropriate interface), but provides no implementation for any of the
4 * methods of this interface (NULL-filled vftbl).
7 #ifndef TESTSIMPLETABLE_H_
8 #define TESTSIMPLETABLE_H_
10 #include <glib-object.h>
15 #include "test-simple-child.h"
16 #include "test-simple-text.h"
18 #define TEST_TYPE_SIMPLE_TABLE (test_simple_table_get_type ())
19 #define TEST_SIMPLE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_SIMPLE_TABLE, TestSimpleTable))
20 #define TEST_SIMPLE_TABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TEST_TYPE_SIMPLE_TABLE, TestSimpleTableClass))
21 #define TEST_IS_SIMPLE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_SIMPLE_TABLE))
22 #define TEST_IS_SIMPLE_TABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TEST_TYPE_SIMPLE_TABLE))
23 #define TEST_SIMPLE_TABLE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TEST_TYPE_SIMPLE_TABLE, TestSimpleTableClass))
25 #define NROWS 4 /* row count */
26 #define NCOLS 5 /* column count */
28 static gint ids[NROWS][NCOLS] =
34 static gint row_ext[NROWS][NCOLS] =
40 static gint col_ext[NROWS][NCOLS] =
46 #define NCHILDREN 16 /* child object count */
48 // default string values
49 #define DEF_CAPTION_TEXT "Default table caption"
50 #define DEF_SUMMARY_TEXT "Default table summary"
51 #define DEF_ROW_DESCR_TPL "Row No%d"
52 #define DEF_COL_DESCR_TPL "Column No%d"
54 // convenience typedefs
55 typedef TestSimpleText TestSimpleHeader;
56 typedef TestSimpleText TestSimpleSummary;
57 //typedef TestSimpleText TestSimpleDescription;
58 typedef TestSimpleText TestSimpleCaption;
60 /* row and column headers */
64 gboolean selected; /* TRUE if the row/column is selected, FALSE otherwise */
65 } TestSimpleHeaderStruct;
67 /* This struct represents a table cell */
70 TestSimpleChild* elem; /* the element */
71 guint ext_row; /* its row extent */
72 guint ext_col; /* its column extent */
75 /* TestSimpleTable class */
76 typedef struct _TestSimpleTable TestSimpleTable;
77 typedef struct _TestSimpleTableClass TestSimpleTableClass;
79 struct _TestSimpleTable
84 /* Children of this object. */
85 TestSimpleChild* child[NCHILDREN];
87 /* This object is not a child of the table object. */
88 TestSimpleChild* not_a_child;
90 /* The table itself. */
91 TestSimpleCell tbl[NROWS][NCOLS];
93 /* Row and column descriptors */
94 TestSimpleHeaderStruct row[NROWS];
95 TestSimpleHeaderStruct col[NCOLS];
97 /* current number of rows and columns */
106 struct _TestSimpleTableClass
108 AtkObjectClass parent;
111 #endif /*TESTSIMPLETABLE_H_*/