summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatryk Kaczmarek <patryk.k@samsung.com>2015-09-29 15:24:49 +0200
committerMike Gorse <mgorse@suse.com>2015-11-23 18:27:46 -0600
commitb1f9f655a80ea7438c9ca3c4a2fb8e95693741e7 (patch)
tree0ad0f096ef91ffe32ecac555e991c994af56914e
parent21d493d78b5e2d16a757fcc05f33c78264f2d609 (diff)
downloadat-spi2-atk-b1f9f655a80ea7438c9ca3c4a2fb8e95693741e7.tar.gz
New tests for last interfaces
* Tested interfaces: - Document - Hyperlink - Hypertext - Selectoin - State Set - Table - Table Cell
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/README70
-rw-r--r--tests/atk-object-xml-loader.c79
-rw-r--r--tests/atk_suite.c57
-rw-r--r--tests/atk_suite.h14
-rw-r--r--tests/atk_test_document.c101
-rw-r--r--tests/atk_test_hyperlink.c165
-rw-r--r--tests/atk_test_hypertext.c95
-rw-r--r--tests/atk_test_selection.c195
-rw-r--r--tests/atk_test_state_set.c250
-rw-r--r--tests/atk_test_table.c478
-rw-r--r--tests/atk_test_table_cell.c206
-rw-r--r--tests/data/test-document.xml7
-rw-r--r--tests/data/test-hypertext.xml6
-rw-r--r--tests/data/test-selection.xml16
-rw-r--r--tests/data/test-table.xml70
-rw-r--r--tests/dummyatk/Makefile.am12
-rw-r--r--tests/dummyatk/my-atk-document.c152
-rw-r--r--tests/dummyatk/my-atk-document.h63
-rw-r--r--tests/dummyatk/my-atk-hyperlink.c217
-rw-r--r--tests/dummyatk/my-atk-hyperlink.h59
-rw-r--r--tests/dummyatk/my-atk-hypertext.c165
-rw-r--r--tests/dummyatk/my-atk-hypertext.h52
-rw-r--r--tests/dummyatk/my-atk-selection.c229
-rw-r--r--tests/dummyatk/my-atk-selection.h61
-rw-r--r--tests/dummyatk/my-atk-table-cell.c208
-rw-r--r--tests/dummyatk/my-atk-table-cell.h62
-rw-r--r--tests/dummyatk/my-atk-table.c682
-rw-r--r--tests/dummyatk/my-atk-table.h68
-rw-r--r--tests/dummyatk/my-atk.h6
30 files changed, 3851 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0ac1ca7..581dc4b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,7 +31,14 @@ atk_test_SOURCES = atk_suite.c \
atk_test_component.c \
atk_test_collection.c \
atk_test_editable_text.c \
+ atk_test_document.c \
+ atk_test_hyperlink.c \
+ atk_test_hypertext.c \
atk_test_image.c \
+ atk_test_selection.c \
+ atk_test_state_set.c \
+ atk_test_table.c \
+ atk_test_table_cell.c \
atk_test_text.c \
atk_test_value.c
diff --git a/tests/README b/tests/README
index b7e141d..011e655 100644
--- a/tests/README
+++ b/tests/README
@@ -108,6 +108,76 @@ AVAILABLE TESTS:
-image_get_image_position
-image_get_image_extents
-image_get_image_locale
+- HyperLink
+ -hyperlink_get_n_anchors
+ -hyperlink_get_uri
+ -hyperlink_get_object
+ -hyperlink_get_index_range
+ -hyperlink_get_start_index
+ -hyperlink_get_end_index
+ -hyperlink_is_valid
+- HyperText
+ -hypertext_get_n_links
+ -hypertext_get_link
+ -hypertext_get_link_index
+- Relation
+ -relation_get_relation_type
+ -relation_get_n_targets
+ -relation_get_target
+- Selection
+ -selection_get_n_selected_children
+ -selection_get_selected_child
+ -selection_select_child
+ -selection_deselect_selected
+ -selection_deselect_child
+ -selection_is_child_selected
+ -selection_select_all
+ -selection_clear_selection
+- State Set
+ -state_set_new
+ -state_set_set_by_name
+ -state_set_add
+ -state_set_compare
+ -state_set_contains
+ -state_set_equals
+ -state_set_get_states
+ -state_set_is_empty
+ -state_set_remove
+- Table
+ -table_get_caption
+ -table_get_summary
+ -table_get_n_rows
+ -table_get_n_columns
+ -table_get_accessible_at
+ -table_get_index_at
+ -table_get_row_at_index
+ -table_get_column_at_index
+ -table_get_row_description
+ -table_get_column_description
+ -table_get_row_extent_at
+ -table_get_column_extent_at
+ -table_get_row_header
+ -table_get_column_header
+ -table_get_n_selected_rows
+ -table_get_selected_rows
+ -table_get_selected_columns
+ -table_get_n_selected_columns
+ -table_is_row_selected
+ -table_is_column_selected
+ -table_add_row_selection
+ -table_add_column_selection
+ -table_remove_row_selection
+ -table_remove_column_selection
+ -table_get_row_column_extents_at_index
+ -table_is_selected
+- Table Cell
+ -table_cell_get_column_span
+ -table_cell_get_column_header_cells
+ -table_cell_get_column_index
+ -table_cell_get_row_span
+ -table_cell_get_row_header_cells
+ -table_cell_get_row_column_span
+ -table_cell_get_table
- Text:
-text_get_character_count
-text_get_text
diff --git a/tests/atk-object-xml-loader.c b/tests/atk-object-xml-loader.c
index f0d4f88..8c312d2 100644
--- a/tests/atk-object-xml-loader.c
+++ b/tests/atk-object-xml-loader.c
@@ -31,17 +31,30 @@
#define ACCESSIBLE_NODE ((const xmlChar *) "accessible")
#define ACC_ACTION_NODE ((const xmlChar *) "accessible_action")
#define ACC_COMPONENT_NODE ((const xmlChar *) "accessible_component")
+#define ACC_DOCUMENT_NODE ((const xmlChar *) "accessible_document")
+#define ACC_HYPERLINK_NODE ((const xmlChar *) "accessible_hyperlink")
+#define ACC_HYPERTEXT_NODE ((const xmlChar *) "accessible_hypertext")
#define ACC_IMAGE_NODE ((const xmlChar *) "accessible_image")
+#define ACC_TABLE_NODE ((const xmlChar *) "accessible_table")
+#define ACC_TABLE_CELL_NODE ((const xmlChar *) "accessible_table_cell")
#define ACC_EDIT_TEXT_NODE ((const xmlChar *) "accessible_editable_text")
#define ACC_TEXT_NODE ((const xmlChar *) "accessible_text")
+#define ACC_SELECTION_NODE ((const xmlChar *) "accessible_selection")
#define ACC_VALUE_NODE ((const xmlChar *) "accessible_value")
#define ACTION_NODE ((const xmlChar *) "action")
+#define DOCUMENT_NODE ((const xmlChar *) "document")
+#define INTERFACE_NODE ((const xmlChar *) "interface")
#define RELATION_NODE ((const xmlChar *) "relation")
#define STATE_NODE ((const xmlChar *) "state")
#define COMPONENT_NODE ((const xmlChar *) "component")
+#define HYPERLINK_NODE ((const xmlChar *) "hyperlink")
+#define HYPERTEXT_NODE ((const xmlChar *) "hypertext")
#define IMAGE_NODE ((const xmlChar *) "image")
+#define TABLE_NODE ((const xmlChar *) "table")
+#define TABLE_CELL_NODE ((const xmlChar *) "table_cell")
#define TEXT_NODE ((const xmlChar *) "text_node")
#define VALUE_NODE ((const xmlChar *) "value_node")
+#define SELECT_NODE ((const xmlChar *) "select_node")
#define NAME_ATTR ((const xmlChar *) "name")
#define DESC_ATTR ((const xmlChar *) "description")
@@ -50,6 +63,12 @@
#define MAX_ATTR ((const xmlChar *) "max")
#define CURRENT_ATTR ((const xmlChar *) "current")
#define STEP_ATTR ((const xmlChar *) "step")
+#define COL_HEADER_ATTR ((const xmlChar *) "col_header")
+#define ROW_HEADER_ATTR ((const xmlChar *) "row_header")
+#define COL_DESC_ATTR ((const xmlChar *) "col_desc")
+#define ROW_DESC_ATTR ((const xmlChar *) "row_desc")
+#define SELECTED_ATTR ((const xmlChar *) "selected")
+#define SELECTED_COL_ATTR ((const xmlChar *) "selected_col")
#define RELATION_TYPE_ATTR ((const xmlChar *) "relation_type")
#define RELATION_TARGET_NAME_ATTR ((const xmlChar *) "target_name")
#define STATE_TYPE_ATTR ((const xmlChar *) "state_enum")
@@ -69,6 +88,16 @@
#define TEXT_BOLD_ATTR ((const xmlChar *) "bold_text")
#define TEXT_UNDERLINE_ATTR ((const xmlChar *) "underline_text")
#define TEXT_DUMMY_ATTR ((const xmlChar *) "dummy_text")
+#define START_ATTR ((const xmlChar *) "start")
+#define END_ATTR ((const xmlChar *) "end")
+#define LINK_ATTR ((const xmlChar *) "link")
+#define CELL_X_ATTR ((const xmlChar *) "cell_x")
+#define CELL_Y_ATTR ((const xmlChar *) "cell_y")
+#define ROW_SPAN_ATTR ((const xmlChar *) "row_span")
+#define COLUMN_SPAN_ATTR ((const xmlChar *) "column_span")
+#define SELECT_ATTR ((const xmlChar *) "selected")
+#define PAGE_ATTR ((const xmlChar *) "page_no")
+#define PAGE_NUM_ATTR ((const xmlChar *) "page_number")
MyAtkObject *relation_target = NULL;
@@ -159,18 +188,37 @@ create_atk_object_from_element (xmlNode *element)
if (!xmlStrcmp (element->name, ACC_COMPONENT_NODE))
type = MY_TYPE_ATK_COMPONENT;
+ if (!xmlStrcmp (element->name, ACC_DOCUMENT_NODE))
+ type = MY_TYPE_ATK_DOCUMENT;
+
if (!xmlStrcmp (element->name, ACC_EDIT_TEXT_NODE))
type = MY_TYPE_ATK_EDITABLE_TEXT;
+ if (!xmlStrcmp (element->name, ACC_HYPERLINK_NODE))
+ type = MY_TYPE_ATK_HYPERTEXT;
+
+ if (!xmlStrcmp (element->name, ACC_HYPERTEXT_NODE))
+ type = MY_TYPE_ATK_HYPERTEXT;
+
if (!xmlStrcmp (element->name, ACC_IMAGE_NODE))
type = MY_TYPE_ATK_IMAGE;
+ if (!xmlStrcmp (element->name, ACC_SELECTION_NODE))
+ type = MY_TYPE_ATK_SELECTION;
+
if (!xmlStrcmp (element->name, ACC_TEXT_NODE))
type = MY_TYPE_ATK_TEXT;
+ if (!xmlStrcmp (element->name, ACC_TABLE_NODE))
+ type = MY_TYPE_ATK_TABLE;
+
+ if (!xmlStrcmp (element->name, ACC_TABLE_CELL_NODE))
+ type = MY_TYPE_ATK_TABLE_CELL;
+
if (!xmlStrcmp (element->name, ACC_VALUE_NODE))
type = MY_TYPE_ATK_VALUE;
+
obj = g_object_new (type,
"accessible-name", name,
"accessible-description", description,
@@ -181,8 +229,14 @@ create_atk_object_from_element (xmlNode *element)
if (!xmlStrcmp (child_node->name, ACCESSIBLE_NODE) ||
!xmlStrcmp (child_node->name, ACC_ACTION_NODE) ||
!xmlStrcmp (child_node->name, ACC_COMPONENT_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_DOCUMENT_NODE) ||
!xmlStrcmp (child_node->name, ACC_EDIT_TEXT_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_HYPERLINK_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_HYPERTEXT_NODE) ||
!xmlStrcmp (child_node->name, ACC_IMAGE_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_SELECTION_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_TABLE_NODE) ||
+ !xmlStrcmp (child_node->name, ACC_TABLE_CELL_NODE) ||
!xmlStrcmp (child_node->name, ACC_TEXT_NODE) ||
!xmlStrcmp (child_node->name, ACC_VALUE_NODE)) {
child_obj = create_atk_object_from_element (child_node);
@@ -236,6 +290,23 @@ create_atk_object_from_element (xmlNode *element)
my_atk_component_set_mdi_zorder (ATK_COMPONENT (child_obj), zorder);
my_atk_component_set_alpha (ATK_COMPONENT (child_obj), alpha);
}
+ if (!xmlStrcmp (child_node2->name, DOCUMENT_NODE)) {
+ my_atk_set_document (ATK_DOCUMENT(child_obj),
+ atoi_get_prop (child_node2, PAGE_ATTR),
+ atoi_get_prop (child_node2, PAGE_NUM_ATTR));
+ }
+ if (!xmlStrcmp (child_node2->name, HYPERLINK_NODE)) {
+ xmlChar *text = xmlGetProp (child_node2, TEXT_TEXT_ATTR);
+
+ my_atk_set_hypertext (ATK_HYPERTEXT (child_obj), (const gchar *)text);
+ xmlFree (text);
+ }
+ if (!xmlStrcmp (child_node2->name, HYPERTEXT_NODE)) {
+ xmlChar *text = xmlGetProp (child_node2, TEXT_TEXT_ATTR);
+
+ my_atk_set_hypertext (ATK_HYPERTEXT (child_obj), (const gchar *)text);
+ xmlFree (text);
+ }
if (!xmlStrcmp (child_node2->name, IMAGE_NODE)) {
image_des = xmlGetProp (child_node2, IMAGE_DES_ATTR);
x_size = atoi_get_prop (child_node2, COMP_X_ATTR);
@@ -269,8 +340,14 @@ create_atk_object_from_element (xmlNode *element)
atoi_get_prop (child_node2, COMP_HEIGHT_ATTR),
attrSet);
}
+ if (!xmlStrcmp (child_node2->name, TABLE_CELL_NODE)) {
+ my_atk_set_table_cell (ATK_TABLE_CELL (child_obj),
+ atoi_get_prop (child_node2, CELL_X_ATTR),
+ atoi_get_prop (child_node2, CELL_Y_ATTR),
+ atoi_get_prop (child_node2, ROW_SPAN_ATTR),
+ atoi_get_prop (child_node2, COLUMN_SPAN_ATTR));
+ }
if (!xmlStrcmp (child_node2->name, VALUE_NODE)) {
-
my_atk_set_value (ATK_VALUE(child_obj),
atof_get_prop (child_node2, MIN_ATTR),
atof_get_prop (child_node2, CURRENT_ATTR),
diff --git a/tests/atk_suite.c b/tests/atk_suite.c
index 82d6a73..c291e2a 100644
--- a/tests/atk_suite.c
+++ b/tests/atk_suite.c
@@ -44,8 +44,15 @@ static const Atk_Test_Case atc[] = {
{ ATK_TEST_PATH_ACTION, atk_test_action },
{ ATK_TEST_PATH_COMP, atk_test_component },
{ ATK_TEST_PATH_COLLECTION, atk_test_collection },
+ { ATK_TEST_PATH_DOC, atk_test_document },
{ ATK_TEST_PATH_EDIT_TEXT, atk_test_editable_text },
+ { ATK_TEST_PATH_HYPERLINK, atk_test_hyperlink },
+ { ATK_TEST_PATH_HYPERTEXT, atk_test_hypertext },
{ ATK_TEST_PATH_IMAGE, atk_test_image },
+ { ATK_TEST_PATH_SELECTION, atk_test_selection },
+ { ATK_TEST_PATH_STATE_SET, atk_test_state_set },
+ { ATK_TEST_PATH_TABLE, atk_test_table },
+ { ATK_TEST_PATH_TABLE_CELL, atk_test_table_cell },
{ ATK_TEST_PATH_TEXT, atk_test_text },
{ ATK_TEST_PATH_VALUE, atk_test_value },
{ NULL, NULL}
@@ -70,8 +77,16 @@ atk_suite_build (int argc, char **argv )
atk_test_action ();
atk_test_component ();
atk_test_collection ();
+ atk_test_document ();
+
atk_test_editable_text ();
+ atk_test_hyperlink ();
+ atk_test_hypertext ();
atk_test_image ();
+ atk_test_selection ();
+ atk_test_state_set ();
+ atk_test_table ();
+ atk_test_table_cell ();
atk_test_text ();
atk_test_value ();
}
@@ -127,18 +142,60 @@ main(int argc, char **argv)
test_result = g_test_run ();
return ( test_result == 0 ) ? 0 : 255;
}
+ if (!g_strcmp0 (one_test, "Document")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_document ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
if (!g_strcmp0 (one_test, "Editable_Text")) {
g_test_init (&argc, &argv, NULL);
atk_test_editable_text ();
test_result = g_test_run ();
return ( test_result == 0 ) ? 0 : 255;
}
+ if (!g_strcmp0 (one_test, "Hyperlink")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_hyperlink ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
+ if (!g_strcmp0 (one_test, "Hypertext")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_hypertext ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
if (!g_strcmp0 (one_test, "Image")) {
g_test_init (&argc, &argv, NULL);
atk_test_image ();
test_result = g_test_run ();
return ( test_result == 0 ) ? 0 : 255;
}
+ if (!g_strcmp0 (one_test, "Selection")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_selection ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
+ if (!g_strcmp0 (one_test, "State_Set")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_state_set ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
+ if (!g_strcmp0 (one_test, "Table")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_table ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
+ if (!g_strcmp0 (one_test, "Table_Cell")) {
+ g_test_init (&argc, &argv, NULL);
+ atk_test_table_cell ();
+ test_result = g_test_run ();
+ return ( test_result == 0 ) ? 0 : 255;
+ }
if (!g_strcmp0 (one_test, "Text")) {
g_test_init (&argc, &argv, NULL);
atk_test_text ();
diff --git a/tests/atk_suite.h b/tests/atk_suite.h
index 9734b5e..07c2e89 100644
--- a/tests/atk_suite.h
+++ b/tests/atk_suite.h
@@ -29,8 +29,15 @@
#define ATK_TEST_PATH_ACTION (const char *)"/Action"
#define ATK_TEST_PATH_COMP (const char *)"/Component"
#define ATK_TEST_PATH_COLLECTION (const char *)"/Collection"
+#define ATK_TEST_PATH_DOC (const char *)"/Document"
#define ATK_TEST_PATH_EDIT_TEXT (const char *)"/Editable_Text"
+#define ATK_TEST_PATH_HYPERLINK (const char *)"/Hyperlink"
+#define ATK_TEST_PATH_HYPERTEXT (const char *)"/Hypertext"
#define ATK_TEST_PATH_IMAGE (const char *)"/Image"
+#define ATK_TEST_PATH_SELECTION (const char *)"/Selection"
+#define ATK_TEST_PATH_STATE_SET (const char *)"/State_Set"
+#define ATK_TEST_PATH_TABLE (const char *)"/Table"
+#define ATK_TEST_PATH_TABLE_CELL (const char *)"/Table_Cell"
#define ATK_TEST_PATH_TEXT (const char *)"/Text"
#define ATK_TEST_PATH_VALUE (const char *)"/Value"
@@ -38,8 +45,15 @@ void atk_test_accessible (void);
void atk_test_action (void);
void atk_test_component (void);
void atk_test_collection (void);
+void atk_test_document (void);
void atk_test_editable_text (void);
+void atk_test_hyperlink (void);
+void atk_test_hypertext (void);
void atk_test_image (void);
+void atk_test_selection (void);
+void atk_test_state_set (void);
+void atk_test_table (void);
+void atk_test_table_cell (void);
void atk_test_text (void);
void atk_test_value (void);
diff --git a/tests/atk_test_document.c b/tests/atk_test_document.c
new file mode 100644
index 0000000..4a2342d
--- /dev/null
+++ b/tests/atk_test_document.c
@@ -0,0 +1,101 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_suite.h"
+#include "atk_test_util.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-document.xml"
+
+static void
+teardown_document_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+static void
+atk_test_document_get_document_iface (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL);
+ AtspiDocument *iface = atspi_accessible_get_document_iface (child);
+ g_assert (iface != NULL);
+}
+
+static void
+atk_test_document_get_locale (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL);
+ AtspiDocument *iface = atspi_accessible_get_document_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpstr (atspi_document_get_locale (iface, NULL), ==, "document_locale");
+}
+
+static void
+atk_test_document_get_attribute_value (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL);
+ AtspiDocument *iface = atspi_accessible_get_document_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpstr (atspi_document_get_document_attribute_value (iface, "atspi1", NULL), ==, "test1");
+ g_assert_cmpstr (atspi_document_get_document_attribute_value (iface, "atspi2", NULL), ==, "test2");
+}
+
+static void
+atk_test_document_get_attributes (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL);
+ AtspiDocument *iface = atspi_accessible_get_document_iface (child);
+ g_assert (iface != NULL);
+
+ GHashTable *attr = atspi_document_get_document_attributes (iface, NULL);
+ GHashTableIter iter;
+ gpointer key, value;
+ g_hash_table_iter_init (&iter, attr);
+
+ gchar *valid_keys[] = {"atspi1", "atspi2"};
+ gchar *valid_values[] = {"test1", "test2"};
+
+ int i=0;
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ g_assert_cmpstr (valid_keys[i], ==, (gchar *)key);
+ g_assert_cmpstr (valid_values[i], ==, (gchar *)value);
+ ++i;
+ }
+}
+
+void
+atk_test_document(void )
+{
+ g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_document_iface",
+ 0, NULL, NULL, atk_test_document_get_document_iface, teardown_document_test);
+ g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_locale",
+ 0, NULL, NULL, atk_test_document_get_locale, teardown_document_test);
+ g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attribute_value",
+ 0, NULL, NULL, atk_test_document_get_attribute_value, teardown_document_test);
+ g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attributes",
+ 0, NULL, NULL, atk_test_document_get_attributes, teardown_document_test );
+}
diff --git a/tests/atk_test_hyperlink.c b/tests/atk_test_hyperlink.c
new file mode 100644
index 0000000..b0b2821
--- /dev/null
+++ b/tests/atk_test_hyperlink.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_test_util.h"
+#include "atk_suite.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-hypertext.xml"
+
+static void
+atk_test_hyperlink_get_n_anchors (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ gint n = atspi_hyperlink_get_n_anchors (obj, NULL);
+ g_assert_cmpint (n, ==, 1);
+}
+
+static void
+atk_test_hyperlink_get_uri (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ gchar *str = atspi_hyperlink_get_uri (obj, 0, NULL);
+ g_assert (str);
+ g_assert_cmpstr (str, ==, "pinkbike.com");
+}
+
+static void
+atk_test_hyperlink_get_object (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ AtspiAccessible *acc = atspi_hyperlink_get_object (obj, 0, NULL);
+ g_assert (acc);
+ AtspiText *at = atspi_accessible_get_text_iface (acc);
+ g_assert (at);
+ gchar *text = atspi_text_get_text (at, 0, 12, NULL);
+ g_assert_cmpstr (text,==,"pinkbike.com");
+ g_free (text);
+}
+
+static void
+atk_test_hyperlink_get_index_range (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ AtspiRange *range = atspi_hyperlink_get_index_range (obj, NULL);
+ g_assert (range);
+ /*
+ ATK do not define this function
+ */
+ g_assert_cmpint (range->start_offset, ==, -1);
+ g_assert_cmpint (range->end_offset, ==, -1);
+ g_free (range);
+}
+
+static void
+atk_test_hyperlink_get_start_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ gint n = atspi_hyperlink_get_start_index (obj, NULL);
+ g_assert_cmpint (n, ==, 69);
+}
+
+static void
+atk_test_hyperlink_get_end_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ gint n = atspi_hyperlink_get_end_index (obj, NULL);
+ g_assert_cmpint (n, ==, 81);
+}
+
+static void
+atk_test_hyperlink_is_valid (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj1 = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj1);
+ AtspiHyperlink *obj = atspi_hypertext_get_link (obj1, 1, NULL);
+ g_assert (obj);
+ g_assert (atspi_hyperlink_is_valid (obj, NULL));
+}
+
+static void
+teardown_hyperlink_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+void
+atk_test_hyperlink(void)
+{
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_n_anchors",
+ 0, NULL, NULL, atk_test_hyperlink_get_n_anchors, teardown_hyperlink_test );
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_uri",
+ 0, NULL, NULL, atk_test_hyperlink_get_uri, teardown_hyperlink_test);
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_object",
+ 0, NULL, NULL, atk_test_hyperlink_get_object, teardown_hyperlink_test);
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_index_range",
+ 0, NULL, NULL, atk_test_hyperlink_get_index_range, teardown_hyperlink_test);
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_start_index",
+ 0, NULL, NULL, atk_test_hyperlink_get_start_index, teardown_hyperlink_test);
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_end_index",
+ 0, NULL, NULL, atk_test_hyperlink_get_end_index, teardown_hyperlink_test);
+ g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_is_valid",
+ 0, NULL, NULL, atk_test_hyperlink_is_valid, teardown_hyperlink_test);
+}
diff --git a/tests/atk_test_hypertext.c b/tests/atk_test_hypertext.c
new file mode 100644
index 0000000..4696a06
--- /dev/null
+++ b/tests/atk_test_hypertext.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_test_util.h"
+#include "atk_suite.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-hypertext.xml"
+
+static void
+atk_test_hypertext_get_n_links (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj);
+ gint cnt = atspi_hypertext_get_n_links (obj, NULL);
+ g_assert_cmpint (cnt, ==, 2);
+}
+
+static void
+atk_test_hypertext_get_link (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj);
+ AtspiHyperlink *link = atspi_hypertext_get_link (obj, 1, NULL);
+ g_assert (link);
+ gchar *str = atspi_hyperlink_get_uri (link, 0, NULL);
+ g_assert (str);
+ g_assert_cmpstr (str, ==, "pinkbike.com");
+
+ g_free (str);
+
+ link = atspi_hypertext_get_link (obj, 0, NULL);
+ str = atspi_hyperlink_get_uri (link, 0, NULL);
+ g_assert_cmpstr (str, ==, "dh-zone.com");
+
+ g_free (str);
+}
+
+static void
+atk_test_hypertext_get_link_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiHypertext *obj = atspi_accessible_get_hypertext_iface (child);
+ g_assert (obj);
+ gint cnt = atspi_hypertext_get_link_index (obj, 15, NULL);
+ g_assert_cmpint (cnt, ==, -1);
+ cnt = atspi_hypertext_get_link_index (obj, 55, NULL);
+ g_assert_cmpint (cnt, ==, 0);
+ cnt = atspi_hypertext_get_link_index (obj, 70, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+}
+
+static void
+teardown_hypertext_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+void
+atk_test_hypertext (void)
+{
+ g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_n_links",
+ 0, NULL, NULL, atk_test_hypertext_get_n_links, teardown_hypertext_test );
+ g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_links",
+ 0, NULL, NULL, atk_test_hypertext_get_link, teardown_hypertext_test );
+ g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_link_index",
+ 0, NULL, NULL, atk_test_hypertext_get_link_index, teardown_hypertext_test );
+}
diff --git a/tests/atk_test_selection.c b/tests/atk_test_selection.c
new file mode 100644
index 0000000..1f89b57
--- /dev/null
+++ b/tests/atk_test_selection.c
@@ -0,0 +1,195 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_suite.h"
+#include "atk_test_util.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-selection.xml"
+
+static void
+teardown_selection_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+static void
+atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+}
+
+static void
+atk_test_selection_get_n_selected_children (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+}
+
+static void
+atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+ gchar* valid_names[] = { "obj2/1", "obj2/2", "obj3/1"};
+
+ AtspiAccessible *o = NULL;
+ int i=0;
+ int selected_count = atspi_selection_get_n_selected_children (iface, NULL);
+ for (i=0; i<selected_count; i++) {
+ o = atspi_selection_get_selected_child (iface, i, NULL);
+ g_assert_cmpstr (atspi_accessible_get_name (o, NULL), ==, valid_names[i]);
+ }
+}
+
+static void
+atk_test_selection_select_child (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+
+ atspi_selection_select_child (iface, 2, NULL);
+ atspi_selection_select_child (iface, 3, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 5);
+}
+
+static void
+atk_test_selection_deselect_selected (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+
+ atspi_selection_select_child (iface, 2, NULL);
+ atspi_selection_select_child (iface, 3, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 5);
+
+ atspi_selection_deselect_selected_child (iface, 2, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 4);
+}
+
+static void
+atk_test_selection_deselect_child (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+
+ atspi_selection_select_child (iface, 2, NULL);
+ atspi_selection_select_child (iface, 3, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 5);
+
+ atspi_selection_deselect_child (iface, 2, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 4);
+}
+
+static void
+atk_test_selection_is_child_selected (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert (atspi_selection_is_child_selected (iface, 0, NULL));
+ g_assert (atspi_selection_is_child_selected (iface, 1, NULL));
+ g_assert (atspi_selection_is_child_selected (iface, 4, NULL));
+ g_assert (!atspi_selection_is_child_selected (iface, 2, NULL));
+ g_assert (!atspi_selection_is_child_selected (iface, 3, NULL));
+}
+
+static void
+atk_test_selection_select_all (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+ atspi_selection_select_all (iface, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 5);
+}
+
+static void
+atk_test_selection_clear_selection (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object");
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiSelection *iface = atspi_accessible_get_selection_iface (child);
+ g_assert (iface != NULL);
+
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 3);
+ atspi_selection_clear_selection (iface, NULL);
+ g_assert_cmpint (atspi_selection_get_n_selected_children (iface, NULL), ==, 0);
+}
+
+void
+atk_test_selection (void)
+{
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_sample_get_interface",
+ 0, NULL, NULL, atk_test_selection_sample_get_interface, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_n_selected_children",
+ 0, NULL, NULL, atk_test_selection_get_n_selected_children, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_selected_child",
+ 0, NULL, NULL, atk_test_selection_get_selected_child, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_child",
+ 0, NULL, NULL, atk_test_selection_select_child, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_selected",
+ 0, NULL, NULL, atk_test_selection_deselect_selected, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_child",
+ 0, NULL, NULL, atk_test_selection_deselect_child, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_is_child_selected",
+ 0, NULL, NULL, atk_test_selection_is_child_selected, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_all",
+ 0, NULL, NULL, atk_test_selection_select_all, teardown_selection_test);
+ g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_clear_selection",
+ 0, NULL, NULL, atk_test_selection_clear_selection, teardown_selection_test);
+
+}
diff --git a/tests/atk_test_state_set.c b/tests/atk_test_state_set.c
new file mode 100644
index 0000000..ea0e9ce
--- /dev/null
+++ b/tests/atk_test_state_set.c
@@ -0,0 +1,250 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_suite.h"
+#include "atk_test_util.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-accessible.xml"
+
+static void
+teardown_state_set_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+static void
+atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = atspi_state_set_get_states (states);
+
+ AtspiStateType valid_states[] = {
+ ATSPI_STATE_MODAL,
+ ATSPI_STATE_MULTI_LINE,
+ };
+ g_assert_cmpint (states_arr->len, ==, 2);
+ int i = 0;
+ for (i = 0; i < states_arr->len; ++i) {
+ g_assert_cmpint (valid_states[i], ==, g_array_index (states_arr, AtspiStateType, i));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MULTI_LINE));
+ }
+}
+
+static void
+atk_test_state_set_new (gpointer fixture, gconstpointer user_data)
+{
+ GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType));
+
+ gint state = 0;
+ state = 11; // ATSPI_STATE_FOCUSABLE
+ g_array_append_val (states_arr, state);
+ state = 12; // ATSPI_STATE_FOCUSED
+ g_array_append_val (states_arr, state);
+
+ g_assert_cmpint (states_arr->len, ==, 2);
+
+ AtspiStateSet *ss = atspi_state_set_new (states_arr);
+
+ AtspiStateType valid_states[] = {
+ ATSPI_STATE_FOCUSABLE,
+ ATSPI_STATE_FOCUSED,
+ };
+
+ g_assert (atspi_state_set_contains (ss, valid_states[0]));
+ g_assert (atspi_state_set_contains (ss, valid_states[1]));
+ int i = 0;
+ for (i = 0; i < states_arr->len; ++i) {
+ g_assert_cmpint (valid_states[i], ==, g_array_index (states_arr, AtspiStateType, i));
+ }
+}
+
+static void
+atk_test_state_set_set_by_name (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = atspi_state_set_get_states (states);
+
+ atspi_state_set_set_by_name (states, "modal", FALSE);
+
+ states_arr = atspi_state_set_get_states (states);
+
+ g_assert_cmpint (states_arr->len, ==, 1);
+ g_assert (!atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MULTI_LINE));
+
+ atspi_state_set_set_by_name (states, "modal", TRUE);
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+}
+
+static void
+atk_test_state_set_add (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+
+ g_assert (!atspi_state_set_contains (states, ATSPI_STATE_FOCUSABLE));
+
+ atspi_state_set_add (states, ATSPI_STATE_FOCUSABLE);
+
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_FOCUSABLE));
+
+}
+
+static void
+atk_test_state_set_compare (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType));
+
+ gint state = 0;
+ state = 11; // ATSPI_STATE_FOCUSABLE
+ g_array_append_val (states_arr, state);
+ state = 12; // ATSPI_STATE_FOCUSED
+ g_array_append_val (states_arr, state);
+
+ g_assert_cmpint (states_arr->len, ==, 2);
+
+ AtspiStateSet *ss = atspi_state_set_new (states_arr);
+
+ AtspiStateSet *ret = atspi_state_set_compare (states, ss);
+
+ g_assert (atspi_state_set_contains (ret, ATSPI_STATE_MODAL));
+ g_assert (atspi_state_set_contains (ret, ATSPI_STATE_MULTI_LINE));
+ g_assert (atspi_state_set_contains (ret, ATSPI_STATE_FOCUSED));
+ g_assert (atspi_state_set_contains (ret, ATSPI_STATE_FOCUSABLE));
+}
+
+static void
+atk_test_state_set_contains (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+
+ g_assert (!atspi_state_set_contains (states, ATSPI_STATE_FOCUSABLE));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+}
+
+static void
+atk_test_state_set_equals (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType));
+
+ gint state = 0;
+ state = 16; // ATSPI_STATE_MODAL
+ g_array_append_val (states_arr, state);
+ state = 17; // ATSPI_STATE_MULTI_LINE
+ g_array_append_val (states_arr, state);
+
+ g_assert_cmpint (states_arr->len, ==, 2);
+
+ AtspiStateSet *ss = atspi_state_set_new (states_arr);
+
+ g_assert (atspi_state_set_equals (states, ss));
+}
+
+static void
+atk_test_state_set_get_states (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = atspi_state_set_get_states (states);
+
+ AtspiStateType valid_states[] = {
+ ATSPI_STATE_MODAL,
+ ATSPI_STATE_MULTI_LINE,
+ };
+ g_assert_cmpint (states_arr->len, ==, 2);
+ int i = 0;
+ for (i = 0; i < states_arr->len; ++i)
+ g_assert_cmpint (valid_states[i], ==, g_array_index (states_arr, AtspiStateType, i));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MULTI_LINE));
+}
+
+static void
+atk_test_state_set_is_empty (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ AtspiStateSet *root_states = atspi_accessible_get_state_set (obj);
+
+ g_assert (!atspi_state_set_is_empty (states));
+ g_assert (atspi_state_set_is_empty (root_states));
+}
+
+static void
+atk_test_state_set_remove (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *obj = get_root_obj (DATA_FILE);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL);
+ AtspiStateSet *states = atspi_accessible_get_state_set (child);
+ GArray *states_arr = atspi_state_set_get_states (states);
+
+ g_assert_cmpint (states_arr->len, ==, 2);
+ atspi_state_set_remove (states, ATSPI_STATE_MODAL);
+
+ states_arr = atspi_state_set_get_states (states);
+
+ g_assert_cmpint (states_arr->len, ==, 1);
+ g_assert (!atspi_state_set_contains (states, ATSPI_STATE_MODAL));
+ g_assert (atspi_state_set_contains (states, ATSPI_STATE_MULTI_LINE));
+}
+
+void
+atk_test_state_set (void)
+{
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_accessible_get_state_set",
+ 0, NULL, NULL, atk_test_accessible_get_state_set, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_new",
+ 0, NULL, NULL, atk_test_state_set_new, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_set_by_name",
+ 0, NULL, NULL, atk_test_state_set_set_by_name, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_add",
+ 0, NULL, NULL, atk_test_state_set_add, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_compare",
+ 0, NULL, NULL, atk_test_state_set_compare, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_contains",
+ 0, NULL, NULL, atk_test_state_set_contains, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_equals",
+ 0, NULL, NULL, atk_test_state_set_equals, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_get_states",
+ 0, NULL, NULL, atk_test_state_set_get_states, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_is_empty",
+ 0, NULL, NULL, atk_test_state_set_is_empty, teardown_state_set_test);
+ g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_remove",
+ 0, NULL, NULL, atk_test_state_set_remove, teardown_state_set_test);
+}
+
diff --git a/tests/atk_test_table.c b/tests/atk_test_table.c
new file mode 100644
index 0000000..e22db4c
--- /dev/null
+++ b/tests/atk_test_table.c
@@ -0,0 +1,478 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_test_util.h"
+#include "atk_suite.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-table.xml"
+
+static void
+atk_test_table_get_caption (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ AtspiAccessible *acc = atspi_table_get_caption (obj, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("caption name", ==, atspi_accessible_get_name (acc, NULL));
+
+}
+
+static void
+atk_test_table_get_summary (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ AtspiAccessible *acc = atspi_table_get_summary (obj, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("table summary name", ==, atspi_accessible_get_name (acc, NULL));
+}
+
+static void
+atk_test_table_get_n_columns (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint cnt = atspi_table_get_n_columns (obj, NULL);
+ g_assert_cmpint (cnt, ==, 3);
+}
+
+static void
+atk_test_table_get_n_rows (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint cnt = atspi_table_get_n_rows (obj, NULL);
+ g_assert_cmpint (cnt, ==, 4);
+}
+
+static void
+atk_test_table_get_accessible_at (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ AtspiAccessible *acc = atspi_table_get_accessible_at (obj, 0, 0, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("cell 0/0", ==, atspi_accessible_get_name (acc, NULL));
+
+ acc = atspi_table_get_accessible_at (obj, 3, 2, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("cell 2/3", ==, atspi_accessible_get_name (acc, NULL));
+}
+
+static void
+atk_test_table_get_index_at (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+
+ gint cnt = atspi_table_get_index_at (obj, 0, 0, NULL);
+ g_assert_cmpint (cnt, ==, 0);
+
+ cnt = atspi_table_get_index_at (obj, 1, 0, NULL);
+ g_assert_cmpint (cnt, ==, 3);
+
+ cnt = atspi_table_get_index_at (obj, 0, 1, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+}
+
+static void
+atk_test_table_get_row_at_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+
+ gint cnt = atspi_table_get_row_at_index (obj, 1, NULL);
+ g_assert_cmpint (cnt, ==, 0);
+
+ cnt = atspi_table_get_row_at_index (obj, 4, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+
+ cnt = atspi_table_get_row_at_index (obj, 6, NULL);
+ g_assert_cmpint (cnt, ==, 2);
+
+ cnt = atspi_table_get_row_at_index (obj, 11, NULL);
+ g_assert_cmpint (cnt, ==, 3);
+}
+
+static void
+atk_test_table_get_column_at_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+
+ gint cnt = atspi_table_get_column_at_index (obj, 6, NULL);
+ g_assert_cmpint (cnt, ==, 0);
+
+ cnt = atspi_table_get_column_at_index (obj, 1, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+
+ cnt = atspi_table_get_column_at_index (obj, 5, NULL);
+ g_assert_cmpint (cnt, ==, 2);
+}
+
+static void
+atk_test_table_get_row_description (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gchar *desc = atspi_table_get_row_description (obj, 0, NULL);
+ g_assert (desc);
+ g_assert_cmpstr (desc, ==, "first row");
+ g_free (desc);
+ desc = atspi_table_get_row_description (obj, 2, NULL);
+ g_assert (desc);
+ g_assert_cmpstr (desc, ==, "third row");
+ g_free (desc);
+}
+
+static void
+atk_test_table_get_column_description (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gchar *desc = atspi_table_get_column_description (obj, 0, NULL);
+ g_assert (desc);
+ g_assert_cmpstr (desc, ==, "first column");
+ g_free (desc);
+ desc = atspi_table_get_column_description (obj, 2, NULL);
+ g_assert (desc);
+ g_assert_cmpstr (desc, ==, "third column");
+ g_free (desc);
+}
+
+static void
+atk_test_table_get_row_extent_at (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint cnt = atspi_table_get_row_extent_at (obj, 1, 1, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+}
+
+static void
+atk_test_table_get_column_extent_at (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint cnt = atspi_table_get_column_extent_at (obj, 1, 1, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+}
+
+static void
+atk_test_table_get_row_header (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ AtspiAccessible *acc = atspi_table_get_row_header (obj, 0, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("row 1 header", ==, atspi_accessible_get_name (acc, NULL));
+ acc = atspi_table_get_row_header (obj, 3, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("row 4 header", ==, atspi_accessible_get_name (acc, NULL));
+}
+
+static void
+atk_test_table_get_column_header (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ AtspiAccessible *acc = atspi_table_get_column_header (obj, 0, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("column 1 header", ==, atspi_accessible_get_name (acc, NULL));
+ acc = atspi_table_get_column_header (obj, 1, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("column 2 header", ==, atspi_accessible_get_name (acc, NULL));
+ acc = atspi_table_get_column_header (obj, 2, NULL);
+ g_assert (acc);
+ g_assert_cmpstr ("column 3 header", ==, atspi_accessible_get_name (acc, NULL));
+}
+
+static void
+atk_test_table_get_n_selected_rows (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint cnt = atspi_table_get_n_selected_rows (obj, NULL);
+ g_assert_cmpint (cnt, ==, 2);
+}
+
+static void
+atk_test_table_get_selected_rows (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ GArray *array = atspi_table_get_selected_rows (obj, NULL);
+ g_assert (array);
+ g_assert_cmpint (array->len, ==, 2);
+ g_assert_cmpint (g_array_index (array,gint, 0), ==, 0);
+ g_assert_cmpint (g_array_index (array,gint, 1), ==, 2);
+ g_array_free (array, TRUE);
+}
+
+static void
+atk_test_table_get_selected_columns (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ GArray *array = atspi_table_get_selected_columns (obj, NULL);
+ g_assert (array);
+ g_assert_cmpint (array->len, ==, 1);
+ g_assert_cmpint (g_array_index (array, gint, 0), ==, 1);
+
+ g_array_free (array, TRUE);
+}
+
+static void
+atk_test_table_get_n_selected_columns (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert(obj);
+ gint cnt = atspi_table_get_n_selected_columns (obj, NULL);
+ g_assert_cmpint (cnt, ==, 1);
+}
+
+static void
+atk_test_table_is_row_selected (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_true (atspi_table_is_row_selected (obj, 0, NULL));
+ g_assert_false (atspi_table_is_row_selected (obj, 1, NULL));
+}
+
+static void
+atk_test_table_is_column_selected (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_true (atspi_table_is_column_selected (obj, 1, NULL));
+ g_assert_false (atspi_table_is_column_selected (obj, 0, NULL));
+}
+
+static void
+atk_test_table_add_row_selection (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_false (atspi_table_is_row_selected (obj, 1, NULL));
+ g_assert_true (atspi_table_add_row_selection (obj, 1, NULL));
+ g_assert_true (atspi_table_is_row_selected (obj, 1, NULL));
+}
+
+static void
+atk_test_table_add_column_selection (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_false (atspi_table_is_column_selected (obj, 2, NULL));
+ g_assert_true (atspi_table_add_column_selection (obj, 2, NULL));
+ g_assert_true (atspi_table_is_column_selected (obj, 2, NULL));
+}
+
+static void
+atk_test_table_remove_row_selection (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_true (atspi_table_is_row_selected (obj, 2, NULL));
+ g_assert_true (atspi_table_remove_row_selection (obj, 2, NULL));
+ g_assert_false (atspi_table_is_row_selected (obj, 2, NULL));
+}
+
+static void
+atk_test_table_remove_column_selection (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_true (atspi_table_is_column_selected (obj, 1, NULL));
+ g_assert_true (atspi_table_remove_column_selection (obj, 1, NULL));
+ g_assert_false (atspi_table_is_column_selected (obj, 1, NULL));
+}
+
+static void
+atk_test_table_get_row_column_extents_at_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ gint row;
+ gint col;
+ gint row_ext;
+ gint col_ext;
+ gboolean is_selected;
+ g_assert_true (atspi_table_get_row_column_extents_at_index (obj, 0, &row, &col, &row_ext, &col_ext, &is_selected, NULL));
+
+ g_assert_cmpint (row, ==, 0);
+ g_assert_cmpint (col, ==, 0);
+ g_assert_cmpint (row_ext, ==, 2);
+ g_assert_cmpint (col_ext, ==, 1);
+ g_assert_false (is_selected);
+}
+
+static void
+atk_test_table_is_selected (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+ AtspiTable *obj = atspi_accessible_get_table_iface (child);
+ g_assert_true (atspi_table_is_selected (obj, 0, 2, NULL));
+ g_assert_false (atspi_table_is_selected (obj, 1, 0, NULL));
+}
+
+static void
+teardown_table_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+void
+atk_test_table(void)
+{
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_caption",
+ 0, NULL, NULL, atk_test_table_get_caption, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_summary",
+ 0, NULL, NULL, atk_test_table_get_summary, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_columns",
+ 0, NULL, NULL, atk_test_table_get_n_columns, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_rows",
+ 0, NULL, NULL, atk_test_table_get_n_rows, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_accessible_at",
+ 0, NULL, NULL, atk_test_table_get_accessible_at, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_index_at",
+ 0, NULL, NULL, atk_test_table_get_index_at, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_at_index",
+ 0, NULL, NULL, atk_test_table_get_row_at_index, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_at_index",
+ 0, NULL, NULL, atk_test_table_get_column_at_index, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_description",
+ 0, NULL, NULL, atk_test_table_get_row_description, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_description",
+ 0, NULL, NULL, atk_test_table_get_column_description, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_extent_at",
+ 0, NULL, NULL, atk_test_table_get_row_extent_at, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_extent_at",
+ 0, NULL, NULL, atk_test_table_get_column_extent_at, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_header",
+ 0, NULL, NULL, atk_test_table_get_row_header, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_header",
+ 0, NULL, NULL, atk_test_table_get_column_header, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_rows",
+ 0, NULL, NULL, atk_test_table_get_n_selected_rows, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_rows",
+ 0, NULL, NULL, atk_test_table_get_selected_rows, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_columns",
+ 0, NULL, NULL, atk_test_table_get_selected_columns, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_columns",
+ 0, NULL, NULL, atk_test_table_get_n_selected_columns, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_row_selected",
+ 0, NULL, NULL, atk_test_table_is_row_selected, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_column_selected",
+ 0, NULL, NULL, atk_test_table_is_column_selected, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_add_row_selection",
+ 0, NULL, NULL, atk_test_table_add_row_selection, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_add_column_selection",
+ 0, NULL, NULL, atk_test_table_add_column_selection, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_remove_row_selection",
+ 0, NULL, NULL, atk_test_table_remove_row_selection, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_remove_column_selection",
+ 0, NULL, NULL, atk_test_table_remove_column_selection, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_column_extents_at_index",
+ 0, NULL, NULL, atk_test_table_get_row_column_extents_at_index, teardown_table_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_selected",
+ 0, NULL, NULL, atk_test_table_is_selected, teardown_table_test);
+}
diff --git a/tests/atk_test_table_cell.c b/tests/atk_test_table_cell.c
new file mode 100644
index 0000000..c431f08
--- /dev/null
+++ b/tests/atk_test_table_cell.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "atk_test_util.h"
+#include "atk_suite.h"
+
+#define DATA_FILE TESTS_DATA_DIR"/test-table.xml"
+
+static void
+atk_test_accessible_get_table_cell (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 9, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+}
+
+static void
+atk_test_table_cell_get_column_span (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 10, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ g_assert_cmpint (3, ==, atspi_table_cell_get_column_span (obj, NULL));
+
+ cell = atspi_accessible_get_child_at_index (child, 11, NULL);
+ obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ g_assert_cmpint (1, ==, atspi_table_cell_get_column_span (obj, NULL));
+}
+
+/*
+static void
+atk_test_table_cell_get_column_header_cells (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 10, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ GPtrArray *ret = atspi_table_cell_get_column_header_cells (obj, NULL);
+ g_assert_cmpint (3, ==, ret->len);
+}
+*/
+
+static void
+atk_test_table_cell_get_column_index (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 10, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ /* ATK Table Cell interface do not implement that func */
+ g_assert_cmpint (-1, ==, atspi_table_cell_get_column_index (obj, NULL));
+}
+
+static void
+atk_test_table_cell_get_row_span (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 9, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ g_assert_cmpint (2, ==, atspi_table_cell_get_row_span (obj, NULL));
+
+ cell = atspi_accessible_get_child_at_index (child, 11, NULL);
+ obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ g_assert_cmpint (1, ==, atspi_table_cell_get_column_span (obj, NULL));
+}
+
+/*
+static void
+atk_test_table_cell_get_row_header_cells (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 10, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ GPtrArray *ret = atspi_table_cell_get_row_header_cells (obj, NULL);
+ g_assert_cmpint (4, ==, ret->len);
+}
+*/
+
+static void
+atk_test_table_cell_get_row_column_span (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 9, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ gint row = 10;
+ gint column = 10;
+ gint row_span = 10;
+ gint column_span = 10;
+
+ atspi_table_cell_get_row_column_span (obj, &row, &column, &row_span, &column_span, NULL);
+
+ g_assert_cmpint (row, ==, 0);
+ g_assert_cmpint (column, ==, 0);
+ g_assert_cmpint (row_span, ==, 2);
+ g_assert_cmpint (column_span, ==, 1);
+}
+
+static void
+atk_test_table_cell_get_table (gpointer fixture, gconstpointer user_data)
+{
+ AtspiAccessible *_obj = get_root_obj (DATA_FILE);
+ g_assert (_obj);
+ AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
+ g_assert (child);
+
+ AtspiAccessible *cell = atspi_accessible_get_child_at_index (child, 9, NULL);
+ AtspiTableCell *obj = atspi_accessible_get_table_cell (cell);
+ g_assert (obj);
+
+ AtspiAccessible *tab = atspi_table_cell_get_table (obj, NULL);
+ g_assert (tab);
+ g_assert (child == tab);
+}
+
+static void
+teardown_table_cell_test (gpointer fixture, gconstpointer user_data)
+{
+ kill (child_pid, SIGTERM);
+}
+
+void
+atk_test_table_cell (void)
+{
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_accessible_get_table_cell",
+ 0, NULL, NULL, atk_test_accessible_get_table_cell, teardown_table_cell_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_span",
+ 0, NULL, NULL, atk_test_table_cell_get_column_span, teardown_table_cell_test);
+ /*
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_header_cells",
+ 0, NULL, NULL, atk_test_table_cell_get_column_header_cells, teardown_table_cell_test);
+ */
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_index",
+ 0, NULL, NULL, atk_test_table_cell_get_column_index, teardown_table_cell_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_span",
+ 0, NULL, NULL, atk_test_table_cell_get_row_span, teardown_table_cell_test);
+ /*
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_header_cells",
+ 0, NULL, NULL, atk_test_table_cell_get_row_header_cells, teardown_table_cell_test);
+ */
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_column_span",
+ 0, NULL, NULL, atk_test_table_cell_get_row_column_span, teardown_table_cell_test);
+ g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_table",
+ 0, NULL, NULL, atk_test_table_cell_get_table, teardown_table_cell_test);
+
+
+}
diff --git a/tests/data/test-document.xml b/tests/data/test-document.xml
new file mode 100644
index 0000000..7363a62
--- /dev/null
+++ b/tests/data/test-document.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" ?>
+<accessible description="Root of the accessible tree" name="root_object" role="accelerator label">
+ <accessible description="first child" name="test" role="alert"/>
+ <accessible_document description="image child" name="my_document" role="text">
+ <document page_numer="7" page_no="2"/>
+ </accessible_document>
+</accessible>
diff --git a/tests/data/test-hypertext.xml b/tests/data/test-hypertext.xml
new file mode 100644
index 0000000..1b6be6d
--- /dev/null
+++ b/tests/data/test-hypertext.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<accessible description="Root of the accessible tree" name="root_object" role="accelerator label">
+ <accessible_hypertext description="first child" name="obj0" role="alert">
+ <hypertext text="This is article about know downhill portals href='dh-zone.com' href='pinkbike.com'" />
+ </accessible_hypertext>
+</accessible>
diff --git a/tests/data/test-selection.xml b/tests/data/test-selection.xml
new file mode 100644
index 0000000..2fc1733
--- /dev/null
+++ b/tests/data/test-selection.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<accessible description="Root of the accessible tree" name="root_object" role="accelerator label">
+ <accessible_selection description="first child" name="obj1" role="alert">
+ <accessible description="first prechild" name="obj2/1" role="arrow">
+ <state state_enum="selected"/>
+ </accessible>
+ <accessible description="second prechild" name="obj2/2" role="canvas" selected="1">
+ <state state_enum="selected"/>
+ </accessible>
+ <accessible description="first prechild" name="obj2/1" role="arrow"/>
+ <accessible description="second prechild" name="obj2/2" role="canvas"/>
+ <accessible description="first prechild" name="obj3/1" role="check menu item">
+ <state state_enum="selected"/>
+ </accessible>
+ </accessible_selection>
+</accessible>
diff --git a/tests/data/test-table.xml b/tests/data/test-table.xml
new file mode 100644
index 0000000..9d6cb50
--- /dev/null
+++ b/tests/data/test-table.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" ?>
+<accessible description="Root of the accessible tree" name="root_object" role="accelerator label">
+ <accessible_table description="first_child" name="obj0" role="table">
+ <accessible description="table caption" name="caption name" role="caption"/>
+ <accessible description="table summary" name="table summary name" role="heading"/>
+ <accessible description="first column" name="col1" role="table column header">
+ <accessible description="first column header" name="column 1 header" role="header"/>
+ </accessible>
+ <accessible description="second column" name="col2" role="table column header">
+ <state state_enum="selected"/>
+ <accessible description="second column header" name="column 2 header" role="header"/>
+ </accessible>
+ <accessible description="third column" name="col3" role="table column header">
+ <accessible description="thrid column header" name="column 3 header" role="header"/>
+ </accessible>
+ <accessible description="first row" name="row1" role="table row header">
+ <state state_enum="selected"/>
+ <accessible description="first row header" name="row 1 header" role="header"/>
+ </accessible>
+ <accessible description="second row" name="row2" role="table row header">
+ <accessible description="second row header" name="row 2 header" role="header"/>
+ </accessible>
+ <accessible description="third row" name="row3" role="table row header">
+ <state state_enum="selected"/>
+ <accessible description="third row header" name="row 3 header" role="header"/>
+ </accessible>
+ <accessible description="fourth row" name="row4" role="table row header">
+ <accessible description="fourth row header" name="row 4 header" role="header"/>
+ </accessible>
+ <accessible_table_cell description="table cell 1" name="cell 0/0" role="table cell">
+ <table_cell cell_x="0" cell_y="0" row_span="2"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 5" name="cell 1/0" role="table cell">
+ <table_cell cell_x="1" cell_y="0" column_span="3"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 9" name="cell 2/0" role="table cell">
+ <state state_enum="selected"/>
+ <table_cell cell_x="2" cell_y="0"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 2" name="cell 0/1" role="table cell">
+ <table_cell cell_x="0" cell_y="1"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 6" name="cell 1/1" role="table cell">
+ <table_cell cell_x="1" cell_y="1"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 10" name="cell 2/1" role="table cell">
+ <table_cell cell_x="2" cell_y="1"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 3" name="cell 0/2" role="table cell">
+ <table_cell cell_x="0" cell_y="2"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 7" name="cell 1/2" role="table cell">
+ <table_cell cell_x="1" cell_y="2"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 11" name="cell 2/2" role="table cell">
+ <table_cell cell_x="2" cell_y="2"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 4" name="cell 0/3" role="table cell">
+ <table_cell cell_x="0" cell_y="3"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 8" name="cell 1/3" role="table cell">
+ <table_cell cell_x="1" cell_y="3"/>
+ </accessible_table_cell>
+ <accessible_table_cell description="table cell 12" name="cell 2/3" role="table cell">
+ <table_cell cell_x="2" cell_y="3"/>
+ </accessible_table_cell>
+ </accessible_table>
+</accessible>
+
+
diff --git a/tests/dummyatk/Makefile.am b/tests/dummyatk/Makefile.am
index e8049b6..c590cce 100644
--- a/tests/dummyatk/Makefile.am
+++ b/tests/dummyatk/Makefile.am
@@ -17,14 +17,26 @@ libdummyatk_la_SOURCES = \
my-atk-action.h \
my-atk-component.c \
my-atk-component.h \
+ my-atk-document.c \
+ my-atk-document.h \
my-atk-editable-text.c \
my-atk-editable-text.h \
+ my-atk-hyperlink.c \
+ my-atk-hyperlink.h \
+ my-atk-hypertext.c \
+ my-atk-hypertext.h \
my-atk-image.c \
my-atk-image.h \
my-atk-text.c \
my-atk-text.h \
my-atk-object.c \
my-atk-object.h \
+ my-atk-table.c \
+ my-atk-table.h \
+ my-atk-table-cell.c \
+ my-atk-table-cell.h \
+ my-atk-selection.c \
+ my-atk-selection.h \
my-atk-value.c \
my-atk-value.h \
my-atk.h
diff --git a/tests/dummyatk/my-atk-document.c b/tests/dummyatk/my-atk-document.c
new file mode 100644
index 0000000..62b0c81
--- /dev/null
+++ b/tests/dummyatk/my-atk-document.c
@@ -0,0 +1,152 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#include "my-atk-document.h"
+
+static void atk_document_interface_init (AtkDocumentIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (MyAtkDocument,
+ my_atk_document,
+ MY_TYPE_ATK_OBJECT,
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_DOCUMENT,
+ atk_document_interface_init));
+
+void
+my_atk_set_document (AtkDocument *obj, gint page, gint page_num)
+{
+ g_return_if_fail (MY_IS_ATK_DOCUMENT(obj));
+ MyAtkDocument *self = MY_ATK_DOCUMENT (obj);
+
+ self->pages = page;
+ self->current_page = page_num;
+
+ AtkAttribute *attr1, *attr2;
+ attr1 = g_malloc (sizeof (AtkAttribute));
+ attr1->name = g_strdup ("atspi1");
+ attr1->value = g_strdup ("test1");
+
+ attr2 = g_malloc (sizeof (AtkAttribute));
+ attr2->name = g_strdup ("atspi2");
+ attr2->value = g_strdup ("test2");
+
+ self->attributes = g_slist_append (NULL, attr1);
+ self->attributes = g_slist_append (self->attributes, attr2);
+}
+
+static void
+my_atk_document_init (MyAtkDocument *obj)
+{
+ obj->disposed = FALSE;
+ obj->locale = NULL;
+ obj->document_type = NULL;
+ obj->pages = 0;
+ obj->current_page = 0;
+}
+
+AtkAttributeSet *
+my_atk_document_get_document_attributes (AtkDocument *document)
+{
+ MyAtkDocument *self = MY_ATK_DOCUMENT (document);
+
+ return self->attributes;
+}
+
+const gchar *
+my_atk_document_get_document_attribute_value (AtkDocument *document, const gchar *value)
+{
+ AtkAttributeSet *attr = my_atk_document_get_document_attributes (document);
+ GSList *cur_attr = (GSList *) attr;
+ AtkAttribute *at;
+
+ while (cur_attr) {
+ at = (AtkAttribute *) cur_attr->data;
+ if (!g_strcmp0 (at->name, value)) {
+ return at->value;
+ }
+ cur_attr = cur_attr->next;
+ }
+ return NULL;
+}
+
+gboolean
+my_atk_document_set_document_attribute (AtkDocument *document, const gchar *attribute_name, const gchar *attribute_value)
+{
+ return FALSE;
+}
+
+gint
+my_atk_document_get_current_page_number (AtkDocument *document)
+{
+ return 0;
+}
+
+gint
+my_atk_document_get_page_count (AtkDocument *document)
+{
+ return 0;
+}
+
+const gchar *
+my_atk_document_get_document_locale (AtkDocument *document)
+{
+
+ return g_strdup("document_locale");
+}
+
+static void
+atk_document_interface_init(AtkDocumentIface *iface)
+{
+ if(!iface) return;
+
+ iface->get_document_locale = my_atk_document_get_document_locale;
+ iface->get_document_attributes = my_atk_document_get_document_attributes;
+ iface->get_document_attribute_value = my_atk_document_get_document_attribute_value;
+ iface->set_document_attribute = my_atk_document_set_document_attribute;
+ iface->get_current_page_number = my_atk_document_get_current_page_number;
+ iface->get_page_count = my_atk_document_get_page_count;
+}
+
+static void
+my_atk_document_initialize(AtkObject *obj, gpointer data)
+{
+}
+
+static void
+my_atk_document_finalize(GObject *object)
+{
+}
+
+static void
+my_atk_document_class_init(MyAtkDocumentClass *my_class)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS(my_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS(my_class);
+
+ gobject_class->finalize = my_atk_document_finalize;
+
+ atk_class->initialize = my_atk_document_initialize;
+}
+
diff --git a/tests/dummyatk/my-atk-document.h b/tests/dummyatk/my-atk-document.h
new file mode 100644
index 0000000..47c9187
--- /dev/null
+++ b/tests/dummyatk/my-atk-document.h
@@ -0,0 +1,63 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_DOCUMENT_H
+#define MY_ATK_DOCUMENT_H
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+#include "my-atk-object.h"
+
+#define MY_TYPE_ATK_DOCUMENT (my_atk_document_get_type ())
+#define MY_ATK_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_DOCUMENT, MyAtkDocument))
+#define MY_ATK_DOCUMENT_CLASS(vdocument) (G_TYPE_CHECK_CLASS_CAST ((vdocument), MY_TYPE_ATK_DOCUMENT, MyAtkDocumentClass))
+#define MY_IS_ATK_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_DOCUMENT))
+#define MY_IS_ATK_DOCUMENT_CLASS(vdocument) (G_TYPE_CHECK_CLASS_TYPE ((vdocument), MY_TYPE_ATK_DOCUMENT))
+#define MY_ATK_DOCUMENT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_DOCUMENT, MyAtkDocumentClass))
+
+// default string values
+#define DEF_LOCALE_TEXT "en-US"
+#define DEF_TYPE_TEXT "default type"
+
+typedef struct _MyAtkDocument MyAtkDocument;
+typedef struct _MyAtkDocumentClass MyAtkDocumentClass;
+
+struct _MyAtkDocument {
+ MyAtkObject parent;
+ gboolean disposed;
+ gchar *locale;
+ gchar *document_type;
+ gint pages;
+ gint current_page;
+ AtkAttributeSet *attributes;
+};
+
+struct _MyAtkDocumentClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_document_get_type (void);
+
+void my_atk_set_document (AtkDocument *obj, gint page, gint page_num);
+
+#endif /*MY_ATK_DOCUMENT_H*/
diff --git a/tests/dummyatk/my-atk-hyperlink.c b/tests/dummyatk/my-atk-hyperlink.c
new file mode 100644
index 0000000..834369d
--- /dev/null
+++ b/tests/dummyatk/my-atk-hyperlink.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <string.h>
+#include <atk/atk.h>
+#include <stdio.h>
+
+#include "my-atk-object.h"
+#include "my-atk-hyperlink.h"
+#include "my-atk-text.h"
+
+typedef struct _MyAtkHyperlinkInfo MyAtkHyperlinkInfo;
+
+G_DEFINE_TYPE (MyAtkHyperlink, my_atk_hyperlink, ATK_TYPE_HYPERLINK)
+
+gint
+my_atk_set_hyperlink (AtkHyperlink *obj, const gchar *uri, gint start, gint end)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), -1);
+
+ self->uri = g_strdup (uri);
+ self->start = start;
+ self->end = end;
+ self->state = FALSE;
+ self->selected = FALSE;
+
+ return 0;
+}
+
+MyAtkHyperlink *
+new_MyAtkHyperlink (void)
+{
+ return g_object_new (MY_TYPE_ATK_HYPERLINK, NULL);
+}
+
+static gchar*
+my_atk_hyperlink_get_uri (AtkHyperlink *obj, gint i)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), NULL);
+
+ return self->uri;
+}
+
+static AtkObject *
+my_atk_hyperlink_get_object (AtkHyperlink *obj, gint i)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ MyAtkText *text;
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), NULL);
+
+ text = my_atk_text_new ();
+ my_atk_set_text (ATK_TEXT (text),
+ self->uri,
+ 10,
+ 50,
+ self->end - self->start,
+ 15,
+ NULL);
+
+ return ATK_OBJECT (text);
+}
+
+static gint
+my_atk_hyperlink_get_end_index (AtkHyperlink *obj)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), -1);
+
+ return self->end;
+}
+
+static gint
+my_atk_hyperlink_get_start_index (AtkHyperlink *obj)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), -1);
+
+ return self->start;
+}
+
+static gboolean
+my_atk_hyperlink_is_valid (AtkHyperlink *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), FALSE);
+
+ return TRUE;
+}
+
+static gint
+my_atk_hyperlink_get_n_anchors (AtkHyperlink *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), -1);
+
+ return 1;
+}
+
+static guint
+my_atk_hyperlink_link_state (AtkHyperlink *obj)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), -1);
+
+ return self->state;
+}
+
+static gboolean
+my_atk_hyperlink_is_selected_link (AtkHyperlink *obj)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERLINK (obj), FALSE);
+
+ return self->selected;
+}
+
+static void
+my_atk_hyperlink_link_activated (AtkHyperlink *obj)
+{
+ MyAtkHyperlink *self = MY_ATK_HYPERLINK (obj);
+ g_return_if_fail (MY_IS_ATK_HYPERLINK (obj));
+
+ self->selected = !self->selected;
+}
+
+static void
+my_atk_hyperlink_init (MyAtkHyperlink *self)
+{
+ self->uri =NULL;
+ self->start = -1;
+ self->end = -1;
+ self->state = FALSE;
+ self->selected = FALSE;
+}
+
+static void
+my_atk_hyperlink_set_property (GObject *obj,
+ guint id,
+ const GValue *value,
+ GParamSpec *spec)
+{
+ switch (id) {
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ default:
+ //G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
+ break;
+ }
+}
+
+static void
+my_atk_hyperlink_get_property (GObject *obj,
+ guint id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+}
+
+static void
+my_atk_hyperlink_class_finalize (GObject *obj)
+{
+}
+
+static void
+my_atk_hyperlink_class_init (MyAtkHyperlinkClass *my_class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (my_class);
+ AtkHyperlinkClass *iface = ATK_HYPERLINK_CLASS (my_class);
+ const gchar *inst_tab[] = {"accessible-name", "accessible-description", "accessible-role", NULL};
+
+ gobject_class->finalize = my_atk_hyperlink_class_finalize;
+ gobject_class->set_property = my_atk_hyperlink_set_property;
+ gobject_class->get_property = my_atk_hyperlink_get_property;
+
+ gint i;
+ for (i = 0; inst_tab[i] != NULL ; i++)
+ g_object_class_install_property (gobject_class,
+ i+1,
+ g_param_spec_string (inst_tab[i],
+ inst_tab[i],
+ inst_tab[i],
+ NULL,
+ G_PARAM_READWRITE)
+ );
+
+ iface->get_uri = my_atk_hyperlink_get_uri;
+ iface->get_object = my_atk_hyperlink_get_object;
+ iface->get_end_index = my_atk_hyperlink_get_end_index;
+ iface->get_start_index = my_atk_hyperlink_get_start_index;
+ iface->is_valid = my_atk_hyperlink_is_valid;
+ iface->get_n_anchors = my_atk_hyperlink_get_n_anchors;
+ iface->link_state = my_atk_hyperlink_link_state;
+ iface->is_selected_link = my_atk_hyperlink_is_selected_link;
+ iface->link_activated = my_atk_hyperlink_link_activated;
+}
diff --git a/tests/dummyatk/my-atk-hyperlink.h b/tests/dummyatk/my-atk-hyperlink.h
new file mode 100644
index 0000000..566d12d
--- /dev/null
+++ b/tests/dummyatk/my-atk-hyperlink.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_HYPERLINK_H_
+#define MY_ATK_HYPERLINK_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+
+#define MY_TYPE_ATK_HYPERLINK (my_atk_hyperlink_get_type ())
+#define MY_ATK_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_HYPERLINK, MyAtkHyperlink))
+#define MY_ATK_HYPERLINK_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_HYPERLINK, MyAtkHyperlinkClass))
+#define MY_IS_ATK_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_HYPERLINK))
+#define MY_IS_ATK_HYPERLINK_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_HYPERLINK))
+#define MY_ATK_HYPERLINK_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_HYPERLINK, MyAtkHyperlinkClass))
+
+typedef struct _MyAtkHyperlink MyAtkHyperlink;
+typedef struct _MyAtkHyperlinkClass MyAtkHyperlinkClass;
+
+struct _MyAtkHyperlink {
+ MyAtkObject parent;
+ gchar *uri;
+ gint start;
+ gint end;
+ gboolean state;
+ gboolean selected;
+};
+
+struct _MyAtkHyperlinkClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_hyperlink_get_type (void);
+
+MyAtkHyperlink * new_MyAtkHyperlink (void);
+
+gint my_atk_set_hyperlink (AtkHyperlink *obj, const gchar *uri, gint start, gint end);
+
+#endif /* MY_ATK_HYPERLINK_H_ */
diff --git a/tests/dummyatk/my-atk-hypertext.c b/tests/dummyatk/my-atk-hypertext.c
new file mode 100644
index 0000000..80abb3f
--- /dev/null
+++ b/tests/dummyatk/my-atk-hypertext.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <string.h>
+#include <atk/atk.h>
+#include <stdio.h>
+
+#include "my-atk-object.h"
+#include "my-atk-hypertext.h"
+#include "my-atk-hyperlink.h"
+
+typedef struct _MyAtkHypertextInfo MyAtkHypertextInfo;
+
+static void atk_hypertext_interface_init (AtkHypertextIface *iface);
+static void GDestroyNotifyGOBJptrArray (gpointer data);
+
+G_DEFINE_TYPE_WITH_CODE (MyAtkHypertext,
+ my_atk_hypertext,
+ MY_TYPE_ATK_OBJECT,
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT,
+ atk_hypertext_interface_init));
+
+gint
+my_atk_set_hypertext (AtkHypertext *obj, const gchar *text)
+{
+ MyAtkHypertext *self = MY_ATK_HYPERTEXT (obj);
+ MyAtkHyperlink *link;
+ gchar *ptr;
+ const gchar *fstr= "href=";
+ gint len = strlen (fstr);
+ gint text_len = strlen (text);
+ gint index = 0;
+ gint start_offset;
+ g_return_val_if_fail (MY_IS_ATK_HYPERTEXT (obj), -1);
+
+ if (text_len < len)
+ return -1;
+
+ while (text) {
+ ptr = g_strstr_len (text + index, text_len - index, fstr);
+ index = ptr - text + len;
+ if (ptr) {
+ if (text_len < index || index < len)
+ break;
+ if (text[index] == '\'') {
+ start_offset = index + 1;
+ while (++index < text_len && text[index] != '\'');
+ if (text[index] != '\'')
+ break;
+ link = new_MyAtkHyperlink ();
+ my_atk_set_hyperlink (ATK_HYPERLINK (link),
+ g_strndup (text + start_offset, index - start_offset),
+ start_offset,
+ index);
+ g_ptr_array_add (self->array, link);
+ }
+ } else
+ break;
+ }
+
+ return self->array->len > 0 ? 0 : -1;
+}
+
+static gint
+my_atk_hypertext_get_n_links (AtkHypertext *obj)
+{
+ MyAtkHypertext *self = MY_ATK_HYPERTEXT (obj);
+ g_return_val_if_fail (MY_IS_ATK_HYPERTEXT (obj), -1);
+ return self->array->len;
+
+}
+
+static AtkHyperlink *
+my_atk_hypertext_get_link (AtkHypertext *obj, gint link_index)
+{
+ MyAtkHypertext *self = MY_ATK_HYPERTEXT (obj);
+ AtkHyperlink *link = NULL;
+ g_return_val_if_fail (MY_IS_ATK_HYPERTEXT (obj), NULL);
+ if (0 <= link_index && link_index < self->array->len)
+ link = g_ptr_array_index (self->array, link_index);
+ return link;
+}
+
+static gint
+my_atk_hypertext_get_link_index (AtkHypertext *obj, gint char_index)
+{
+ MyAtkHypertext *self = MY_ATK_HYPERTEXT (obj);
+ gint i;
+ MyAtkHyperlink *link;
+ g_return_val_if_fail (MY_IS_ATK_HYPERTEXT (obj), -1);
+
+ for (i = 0; i < self->array->len; i++) {
+ link = g_ptr_array_index (self->array, i);
+ if (link->start <= char_index && char_index <= link->end)
+ return i;
+ }
+ return -1;
+}
+
+static void
+my_atk_hypertext_link_selected (AtkHypertext *obj, gint link_index)
+{
+ g_return_if_fail (MY_IS_ATK_HYPERTEXT (obj));
+}
+
+static void
+GDestroyNotifyGOBJptrArray (gpointer data)
+{
+ g_object_unref (data);
+}
+
+static void
+atk_hypertext_interface_init (AtkHypertextIface *iface)
+{
+ if (!iface) return;
+ iface->get_n_links = my_atk_hypertext_get_n_links;
+ iface->get_link = my_atk_hypertext_get_link;
+ iface->get_link_index = my_atk_hypertext_get_link_index;
+ iface->link_selected = my_atk_hypertext_link_selected;
+}
+
+static void
+my_atk_hypertext_init (MyAtkHypertext *self)
+{
+ self->array = g_ptr_array_new_full (2, GDestroyNotifyGOBJptrArray);
+}
+
+static void
+my_atk_hypertext_class_initialize (AtkObject *obj, gpointer data)
+{
+}
+
+static void
+my_atk_hypertext_class_finalize (GObject *obj)
+{
+}
+
+static void
+my_atk_hypertext_class_init(MyAtkHypertextClass *my_class)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS(my_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS(my_class);
+
+ gobject_class->finalize = my_atk_hypertext_class_finalize;
+
+ atk_class->initialize = my_atk_hypertext_class_initialize;
+}
diff --git a/tests/dummyatk/my-atk-hypertext.h b/tests/dummyatk/my-atk-hypertext.h
new file mode 100644
index 0000000..2dd7409
--- /dev/null
+++ b/tests/dummyatk/my-atk-hypertext.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_HYPERTEXT_H_
+#define MY_ATK_HYPERTEXT_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#define MY_TYPE_ATK_HYPERTEXT (my_atk_hypertext_get_type ())
+#define MY_ATK_HYPERTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_HYPERTEXT, MyAtkHypertext))
+#define MY_ATK_HYPERTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_HYPERTEXT, MyAtkHypertextClass))
+#define MY_IS_ATK_HYPERTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_HYPERTEXT))
+#define MY_IS_ATK_HYPERTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_HYPERTEXT))
+#define MY_ATK_HYPERTEXT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_HYPERTEXT, MyAtkHypertextClass))
+
+typedef struct _MyAtkHypertext MyAtkHypertext;
+typedef struct _MyAtkHypertextClass MyAtkHypertextClass;
+
+struct _MyAtkHypertext {
+ MyAtkObject parent;
+ GPtrArray *array;
+};
+
+struct _MyAtkHypertextClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_hypertext_get_type (void);
+
+gint my_atk_set_hypertext (AtkHypertext *obj, const gchar *text);
+
+#endif /* MY_ATK_HYPERTEXT_H_ */
diff --git a/tests/dummyatk/my-atk-selection.c b/tests/dummyatk/my-atk-selection.c
new file mode 100644
index 0000000..bf706cc
--- /dev/null
+++ b/tests/dummyatk/my-atk-selection.c
@@ -0,0 +1,229 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#include "my-atk-selection.h"
+
+static void atk_selection_interface_init (AtkSelectionIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (MyAtkSelection,
+ my_atk_selection,
+ MY_TYPE_ATK_OBJECT,
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION,
+ atk_selection_interface_init));
+
+static void
+my_atk_selection_init (MyAtkSelection *obj)
+{
+}
+
+static gboolean
+my_atk_selection_add_selection (AtkSelection *selection, gint i)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ if (!self)
+ return FALSE;
+
+ AtkObject *child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ AtkStateSet *ss = atk_object_ref_state_set (child);
+ atk_state_set_add_state (ss, ATK_STATE_SELECTED);
+ return atk_state_set_contains_state (ss, ATK_STATE_SELECTED);
+}
+
+static gboolean
+my_atk_selection_clear_selection (AtkSelection *selection)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ if (!self)
+ return FALSE;
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ int i;
+ int childs = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
+
+ for (i=0; i<childs; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ atk_state_set_remove_state (states, ATK_STATE_SELECTED);
+ }
+ return TRUE;
+}
+
+static AtkObject*
+my_atk_selection_ref_selection (AtkSelection *selection, gint no)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ if (!self)
+ return FALSE;
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ GArray *array = g_array_new (FALSE, FALSE, sizeof (AtkObject *));
+ int i;
+ int childs = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
+
+ for (i=0; i<childs; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (states, ATK_STATE_SELECTED))
+ g_array_append_val (array, child);
+ }
+
+ return g_array_index (array, AtkObject *, no);
+}
+
+static gint
+my_atk_selection_get_selection_count (AtkSelection *selection)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ if (!self)
+ return FALSE;
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ int i, ret=0;
+ int childs = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
+
+ for (i=0; i<childs; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (states, ATK_STATE_SELECTED))
+ ret++;
+
+ }
+ return ret;
+}
+
+static gboolean
+my_atk_selection_is_child_selected (AtkSelection *selection, gint i)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ if (!self)
+ return FALSE;
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (states, ATK_STATE_SELECTED))
+ return TRUE;
+ return FALSE;
+}
+
+static gboolean
+my_atk_selection_remove_selection (AtkSelection *selection, gint no)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ GArray *array = NULL;
+ AtkObject *o = NULL;
+ int i;
+ int childs;
+ gboolean ret = FALSE;
+
+ if (!self)
+ return FALSE;
+ array = g_array_new (FALSE, FALSE, sizeof (AtkObject *));
+ childs = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
+
+ for (i=0; i<childs; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (states, ATK_STATE_SELECTED))
+ g_array_append_val (array, child);
+ }
+ g_object_unref (states);
+
+ o = g_array_index (array, AtkObject *, no);
+ states = atk_object_ref_state_set (o);
+ atk_state_set_remove_state (states, ATK_STATE_SELECTED);
+
+ ret = !atk_state_set_contains_state (states, ATK_STATE_SELECTED);
+ g_object_unref (states);
+ g_object_unref (o);
+ g_object_unref (self);
+ g_array_free (array, TRUE);
+
+ return ret;
+}
+
+static gboolean
+my_atk_selection_select_all_selection (AtkSelection *selection)
+{
+ MyAtkSelection *self = MY_ATK_SELECTION(selection);
+ AtkObject *child = NULL;
+ AtkStateSet *states = NULL;
+ int i;
+ int childs;
+
+ if (!self)
+ return FALSE;
+ childs = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
+
+ for (i=0; i<childs; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (selection), i);
+ states = atk_object_ref_state_set (child);
+ atk_state_set_add_state (states, ATK_STATE_SELECTED);
+ g_object_unref (states);
+ g_object_unref (child);
+ }
+
+ g_object_unref (self);
+ return TRUE;
+}
+
+static void
+atk_selection_interface_init (AtkSelectionIface *iface)
+{
+ if(!iface) return;
+
+ iface->add_selection = my_atk_selection_add_selection;
+ iface->clear_selection = my_atk_selection_clear_selection;
+ iface->ref_selection = my_atk_selection_ref_selection;
+ iface->get_selection_count = my_atk_selection_get_selection_count;
+ iface->is_child_selected = my_atk_selection_is_child_selected;
+ iface->remove_selection = my_atk_selection_remove_selection;
+ iface->select_all_selection = my_atk_selection_select_all_selection;
+}
+
+static void
+my_atk_selection_initialize (AtkObject *obj, gpointer data)
+{
+}
+
+static void
+my_atk_selection_finalize (GObject *obj)
+{
+}
+
+static void
+my_atk_selection_class_init (MyAtkSelectionClass *my_class)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS(my_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS(my_class);
+
+ gobject_class->finalize = my_atk_selection_finalize;
+
+ atk_class->initialize = my_atk_selection_initialize;
+}
diff --git a/tests/dummyatk/my-atk-selection.h b/tests/dummyatk/my-atk-selection.h
new file mode 100644
index 0000000..be932e0
--- /dev/null
+++ b/tests/dummyatk/my-atk-selection.h
@@ -0,0 +1,61 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_SELECTION_H
+#define MY_ATK_SELECTION_H
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+
+#define MY_TYPE_ATK_SELECTION (my_atk_selection_get_type ())
+#define MY_ATK_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_SELECTION, MyAtkSelection))
+#define MY_ATK_SELECTION_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_SELECTION, MyAtkSelectionClass))
+#define MY_IS_ATK_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_SELECTION))
+#define MY_IS_ATK_SELECTION_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_SELECTION))
+#define MY_ATK_SELECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_SELECTION, MyAtkSelectionClass))
+
+/* Number of child objects for the MyAtkSelection instance */
+#define TEST_SELECTION_NCHILDREN 10
+
+typedef struct _MyAtkSelection MyAtkSelection;
+typedef struct _MyAtkSelectionClass MyAtkSelectionClass;
+
+struct _MyAtkSelection {
+ MyAtkObject parent;
+// gboolean disposed;
+ // gboolean multisel_supported;
+ // MyAtkObject* child[TEST_SELECTION_NCHILDREN];
+ // gboolean is_selected[TEST_SELECTION_NCHILDREN];
+};
+
+struct _MyAtkSelectionClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_selection_get_type (void);
+
+guint my_atk_selection_set (MyAtkSelection *selection);
+#endif /*MY_ATK_SELECTION_H*/
+
diff --git a/tests/dummyatk/my-atk-table-cell.c b/tests/dummyatk/my-atk-table-cell.c
new file mode 100644
index 0000000..2d1c568
--- /dev/null
+++ b/tests/dummyatk/my-atk-table-cell.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <string.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#include "my-atk-table.h"
+#include "my-atk-table-cell.h"
+
+typedef struct _MyAtkTableCellInfo MyAtkTableCellInfo;
+
+static void atk_tablecell_interface_init (AtkTableCellIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (MyAtkTableCell,
+ my_atk_tablecell,
+ MY_TYPE_ATK_OBJECT,
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE_CELL,
+ atk_tablecell_interface_init));
+
+gboolean
+my_atk_set_table_cell (AtkTableCell *cell, gint x, gint y, gint row_span, gint column_span)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (cell), FALSE);
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (cell);
+
+ self->x = x;
+ self->y = y;
+ self->row_span = row_span;
+ self->column_span = column_span;
+
+ /* Default value for span is 1, so that condition is needed */
+ if (row_span == 0)
+ self->row_span = 1;
+ if (column_span == 0)
+ self->column_span = 1;
+
+ return TRUE;
+
+}
+gboolean
+my_atk_set_tablecell (MyAtkTableCell *self, gpointer value, const gchar *row_desc, MyAtkObject *parent_table, gboolean selected, gint *xy)
+{
+ self->value = value;
+ self->row_desc = g_strdup (row_desc);
+ self->parent_table = parent_table;
+ self->selected = selected;
+
+ memcpy (self->xy, xy, sizeof (self->xy));
+ return TRUE;
+}
+
+static gint
+my_atk_tablecell_get_column_span (AtkTableCell *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), -1);
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (obj);
+ return self->column_span;
+}
+
+static gboolean
+my_atk_tablecell_get_row_column_span (AtkTableCell *obj, gint *row, gint *col, gint *row_span, gint *col_span)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), FALSE);
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (obj);
+ *col = self->x;
+ *row = self->y;
+ *row_span = self->row_span;
+ *col_span = self->column_span;
+ return TRUE;
+}
+
+static GPtrArray *
+my_atk_tablecell_get_column_header_cells (AtkTableCell *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), FALSE);
+ MyAtkTable *tab = MY_ATK_TABLE (atk_object_get_parent (ATK_OBJECT (obj)));
+
+ gint i, all_child;
+ all_child = MY_ATK_OBJECT (tab)->children->len;
+ AtkObject *child = NULL;
+ GPtrArray *ret = g_ptr_array_new_full (atk_table_get_n_columns ATK_TABLE (tab), g_object_unref);
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (tab), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER) {
+ g_ptr_array_add (ret, child);
+ }
+ }
+
+ return ret;
+}
+
+static AtkObject *
+my_atk_tablecell_get_table (AtkTableCell *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), NULL);
+
+ return atk_object_get_parent (ATK_OBJECT (obj));
+}
+
+static gint
+my_atk_tablecell_get_row_span (AtkTableCell *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), -1);
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (obj);
+ return self->row_span;
+}
+
+static gboolean
+my_atk_tablecell_get_position (AtkTableCell *obj, gint *row , gint *column)
+{
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), FALSE);
+
+ *row = self->xy[0];
+ *column = self->xy[1];
+
+ return FALSE;
+}
+
+static GPtrArray *
+my_atk_tablecell_get_row_header_cells (AtkTableCell *obj)
+{
+ g_return_val_if_fail (MY_IS_ATK_TABLE_CELL (obj), FALSE);
+ MyAtkTable *tab = MY_ATK_TABLE (atk_object_get_parent (ATK_OBJECT (obj)));
+
+ gint i, all_child;
+ all_child = MY_ATK_OBJECT (tab)->children->len;
+ AtkObject *child = NULL;
+ GPtrArray *ret = g_ptr_array_new_full (atk_table_get_n_columns ATK_TABLE (tab), g_object_unref);
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (tab), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER) {
+ g_ptr_array_add (ret, child);
+ }
+ }
+
+ return ret;
+}
+
+static void
+atk_tablecell_interface_init (AtkTableCellIface *iface)
+{
+ if (!iface) return;
+ iface->get_column_span = my_atk_tablecell_get_column_span;
+ iface->get_column_header_cells = my_atk_tablecell_get_column_header_cells;
+ iface->get_position = my_atk_tablecell_get_position;
+ iface->get_row_span = my_atk_tablecell_get_row_span;
+ iface->get_row_header_cells = my_atk_tablecell_get_row_header_cells;
+ iface->get_row_column_span = my_atk_tablecell_get_row_column_span;
+ iface->get_table = my_atk_tablecell_get_table;
+}
+
+static void
+my_atk_tablecell_init (MyAtkTableCell *self)
+{
+ self->value = NULL;
+ self->parent_table = NULL;
+ self->row_desc = NULL;
+ self->selected = FALSE;
+ memset (self->xy, -1, sizeof (self->xy));
+ self->column_span = 1;
+ self->row_span = 1;
+ self->x = -1;
+ self->y = -1;
+ self->column_index = -1;
+}
+
+static void
+my_atk_tablecell_class_initialize (AtkObject *obj, gpointer data)
+{
+}
+
+static void
+my_atk_tablecell_class_finalize (GObject *obj)
+{
+}
+
+static void
+my_atk_tablecell_class_init (MyAtkTableCellClass *my_class)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS (my_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (my_class);
+
+ gobject_class->finalize = my_atk_tablecell_class_finalize;
+
+ atk_class->initialize = my_atk_tablecell_class_initialize;
+}
diff --git a/tests/dummyatk/my-atk-table-cell.h b/tests/dummyatk/my-atk-table-cell.h
new file mode 100644
index 0000000..78f8dd0
--- /dev/null
+++ b/tests/dummyatk/my-atk-table-cell.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_TABLE_CELL_H_
+#define MY_ATK_TABLE_CELL_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#define MY_TYPE_ATK_TABLE_CELL (my_atk_tablecell_get_type ())
+#define MY_ATK_TABLE_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_TABLE_CELL, MyAtkTableCell))
+#define MY_ATK_TABLE_CELL_CLASS (vtablecell) (G_TYPE_CHECK_CLASS_CAST ((vtablecell), MY_TYPE_ATK_TABLE_CELL, MyAtkTableCellClass))
+#define MY_IS_ATK_TABLE_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_TABLE_CELL))
+#define MY_IS_ATK_TABLE_CELL_CLASS (vtablecell) (G_TYPE_CHECK_CLASS_TYPE ((vtablecell), MY_TYPE_ATK_TABLE_CELL))
+#define MY_ATK_TABLE_CELL_GET_CLASS (inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_TABLE_CELL, MyAtkTableCellClass))
+
+typedef struct _MyAtkTableCell MyAtkTableCell;
+typedef struct _MyAtkTableCellClass MyAtkTableCellClass;
+
+struct _MyAtkTableCell {
+ MyAtkObject parent;
+ MyAtkObject *parent_table;
+ gpointer value;
+ gint x;
+ gint y;
+ gint column_span;
+ gint row_span;
+ gint column_index;
+ gboolean selected;
+ gchar *row_desc;
+ gint xy[2];
+};
+
+struct _MyAtkTableCellClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_tablecell_get_type (void);
+
+gboolean my_atk_set_table_cell (AtkTableCell *self, gint x, gint y, gint row, gint column);
+gboolean my_atk_set_tablecell (MyAtkTableCell *self, gpointer value, const gchar *row_desc, MyAtkObject *parent_table, gboolean selected, gint *xy);
+
+#endif /* MY_ATK_TABLE_CELL_H_ */
diff --git a/tests/dummyatk/my-atk-table.c b/tests/dummyatk/my-atk-table.c
new file mode 100644
index 0000000..58fd1bd
--- /dev/null
+++ b/tests/dummyatk/my-atk-table.c
@@ -0,0 +1,682 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <string.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#include "my-atk-table.h"
+#include "my-atk-table-cell.h"
+
+typedef struct _MyAtkTableInfo MyAtkTableInfo;
+
+static void GDestroyNotifyGPTRARRAYptrArray (gpointer data);
+static void atk_table_interface_init (AtkTableIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (MyAtkTable,
+ my_atk_table,
+ MY_TYPE_ATK_OBJECT,
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE,
+ atk_table_interface_init));
+
+
+static gint
+my_atk_table_get_index_at (AtkTable *obj, gint row, gint column)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint i, all_child, index_first_cell = -1;
+ gint ret = -1;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+
+ MyAtkTableCell *cell = NULL;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_CELL) {
+ if (index_first_cell == -1) {
+ index_first_cell = i;
+ }
+ cell = MY_ATK_TABLE_CELL (child);
+ if (cell->x == column && cell->y == row) {
+ ret = i-index_first_cell;
+ }
+ }
+ }
+ return ret;
+}
+
+static gint
+my_atk_table_get_column_at_index (AtkTable *obj, gint index)
+{
+ MyAtkTable *table = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint columns = -1;
+ gint rows = -1;
+ gint i, j;
+
+ columns = atk_table_get_n_columns (ATK_TABLE (table));
+ rows = atk_table_get_n_rows (ATK_TABLE (table));
+
+ for (i = 0; i < rows; i++) {
+ for (j = 0; j < columns; j++) {
+ if (index == my_atk_table_get_index_at (obj, i, j))
+ return j;
+ }
+ }
+ return -1;
+}
+
+static gint
+my_atk_table_get_row_at_index (AtkTable *obj, gint index)
+{
+ MyAtkTable *table = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint columns = -1;
+ gint rows = -1;
+ gint i, j;
+
+ columns = atk_table_get_n_columns (ATK_TABLE (table));
+ rows = atk_table_get_n_rows (ATK_TABLE (table));
+
+ for (i = 0; i < rows; i++) {
+ for (j = 0; j < columns; j++) {
+ if (index == my_atk_table_get_index_at (obj, i, j))
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+static gint
+my_atk_table_get_n_columns (AtkTable *obj)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint i, all_child, ret=0;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER)
+ ret++;
+ }
+ return ret;
+}
+
+static gint
+my_atk_table_get_n_rows (AtkTable *obj)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint i, all_child, ret=0;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER)
+ ret++;
+ }
+ return ret;
+}
+
+static AtkObject*
+my_atk_table_get_caption (AtkTable *obj)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ AtkObject *caption = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_CAPTION)
+ caption = child;
+ }
+ return caption ? caption : NULL;
+}
+
+static AtkObject*
+my_atk_table_ref_at (AtkTable *obj, gint row, gint column)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ AtkObject *ret = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+
+ MyAtkTableCell *cell = NULL;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_CELL) {
+ cell = MY_ATK_TABLE_CELL (child);
+ if (cell->x == column && cell->y == row)
+ ret = ATK_OBJECT (cell);
+ }
+ }
+ return ret ? ret : NULL;
+}
+
+static const gchar *
+my_atk_table_get_row_description (AtkTable *obj, gint index)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ GPtrArray *ret = g_ptr_array_new_full ( my_atk_table_get_n_rows (obj),
+ g_object_unref);
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ child = g_ptr_array_index (ret, index);
+
+ return g_strdup (atk_object_get_description (child));
+}
+
+static const gchar *
+my_atk_table_get_column_description (AtkTable *obj, gint index)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ GPtrArray *ret = g_ptr_array_new_full (my_atk_table_get_n_columns (obj), g_object_unref);
+
+ all_child = MY_ATK_OBJECT(self)->children->len;
+ AtkObject *child = NULL;
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ child = g_ptr_array_index (ret, index);
+
+ return g_strdup (atk_object_get_description (child));
+}
+
+static gint
+my_atk_table_test_table_get_row_extent_at (AtkTable *obj, gint row, gint col)
+{
+ AtkObject *cell = my_atk_table_ref_at (obj, row, col);
+
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (cell);
+
+ return self->row_span;
+}
+
+static gint
+my_atk_table_test_table_get_column_extent_at (AtkTable *obj, gint row, gint col)
+{
+ AtkObject *cell = my_atk_table_ref_at (obj, row, col);
+
+ MyAtkTableCell *self = MY_ATK_TABLE_CELL (cell);
+
+ return self->column_span;
+}
+
+static AtkObject*
+my_atk_table_get_row_header (AtkTable *obj, gint row)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ GPtrArray *ret = g_ptr_array_new_full (my_atk_table_get_n_rows (obj), g_object_unref);
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+ AtkObject *c = NULL;
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ c = ATK_OBJECT (g_ptr_array_index (ret, row));
+
+ return atk_object_ref_accessible_child (c, 0);
+}
+
+static AtkObject*
+my_atk_table_get_column_header (AtkTable *obj, gint col)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ GPtrArray *ret = g_ptr_array_new_full (my_atk_table_get_n_rows (obj), g_object_unref);
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ AtkObject *child = NULL;
+ AtkObject *c = NULL;
+
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ c = g_ptr_array_index (ret, col);
+
+ return atk_object_ref_accessible_child (c, 0);
+}
+
+gint
+my_atk_table_get_selected_rows (AtkTable *obj, gint **selected)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint i, all_child, row = 0, ret = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ GArray *array = g_array_new (FALSE, FALSE, sizeof (gint));
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i=0; i<all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER) {
+ ss = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ ret++;
+ g_array_append_val (array, row);
+ }
+ row++;
+ }
+ }
+ if (selected)
+ *selected = (gint *) g_array_free (array, FALSE);
+ return ret;
+}
+
+gint
+my_atk_table_get_selected_columns (AtkTable *obj, gint **selected)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), -1);
+ gint i, all_child, column = 0, ret = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ GArray *array = g_array_new (FALSE, FALSE, sizeof (gint));
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i=0; i<all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER) {
+ ss = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ ret++;
+ g_array_append_val (array, column);
+ }
+ column++;
+ }
+ }
+ if (selected)
+ *selected = (gint *) g_array_free (array, FALSE);
+ return ret;
+}
+
+static gboolean
+my_atk_table_is_row_selected (AtkTable *obj, gint row)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child;
+ AtkObject *child = NULL;
+ AtkObject *c = NULL;
+ AtkStateSet *ss = NULL;
+ GPtrArray *ret = g_ptr_array_new_full (my_atk_table_get_n_rows (obj), g_object_unref);
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ c = g_ptr_array_index (ret, row);
+ ss = atk_object_ref_state_set (c);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED))
+ return TRUE;
+ return FALSE;
+}
+
+static gboolean
+my_atk_table_is_column_selected (AtkTable *obj, gint col)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child;
+ AtkObject *child = NULL;
+ AtkObject *c = NULL;
+ AtkStateSet *ss = NULL;
+ GPtrArray *ret = g_ptr_array_new_full (my_atk_table_get_n_columns (obj), g_object_unref);
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER)
+ g_ptr_array_add (ret, child);
+ }
+ c = g_ptr_array_index (ret, col);
+ ss = atk_object_ref_state_set (c);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED))
+ return TRUE;
+ return FALSE;
+}
+
+static gboolean
+my_atk_table_is_selected (AtkTable *obj, gint row, gint col)
+{
+ AtkObject *cell = atk_table_ref_at (obj, row, col);
+ AtkStateSet *ss = atk_object_ref_state_set (cell);
+ gboolean ret = FALSE;
+
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED))
+ ret = TRUE;
+ return ret;
+}
+
+static gboolean
+my_atk_table_add_column_selection (AtkTable *obj, gint col)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child, counter = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER) {
+ if (col == counter) {
+ ss = atk_object_ref_state_set (child);
+ if (!atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ atk_state_set_add_state (ss, ATK_STATE_SELECTED);
+ return TRUE;
+ }
+ }
+ counter++;
+ }
+ }
+ return FALSE;
+}
+
+static gboolean
+my_atk_table_add_row_selection (AtkTable *obj, gint row)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child, counter = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER) {
+ if (row == counter) {
+ ss = atk_object_ref_state_set (child);
+ if (!atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ atk_state_set_add_state (ss, ATK_STATE_SELECTED);
+ return TRUE;
+ }
+ }
+ counter++;
+ }
+ }
+ return FALSE;
+}
+
+static gboolean
+my_atk_table_remove_column_selection (AtkTable *obj, gint col)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child, counter = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_COLUMN_HEADER) {
+ if (col == counter) {
+ ss = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ atk_state_set_remove_state (ss, ATK_STATE_SELECTED);
+ return TRUE;
+ }
+ }
+ counter++;
+ }
+ }
+ return FALSE;
+}
+
+static gboolean
+my_atk_table_remove_row_selection (AtkTable *obj, gint row)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), FALSE);
+ gint i, all_child, counter = 0;
+ AtkObject *child = NULL;
+ AtkStateSet *ss = NULL;
+
+ all_child = MY_ATK_OBJECT (self)->children->len;
+ for (i = 0; i < all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_TABLE_ROW_HEADER) {
+ if (row == counter) {
+ ss = atk_object_ref_state_set (child);
+ if (atk_state_set_contains_state (ss, ATK_STATE_SELECTED)) {
+ atk_state_set_remove_state (ss, ATK_STATE_SELECTED);
+ return TRUE;
+ }
+ }
+ counter++;
+ }
+ }
+ return FALSE;
+}
+
+static AtkObject *
+my_atk_table_get_summary (AtkTable *obj)
+{
+ MyAtkTable *self = MY_ATK_TABLE (obj);
+ g_return_val_if_fail (MY_IS_ATK_TABLE (obj), NULL);
+ gint i, all_child;
+ AtkObject *summary = NULL;
+
+ all_child = MY_ATK_OBJECT(self)->children->len;
+ AtkObject *child = NULL;
+ for (i=0; i<all_child; i++) {
+ child = atk_object_ref_accessible_child (ATK_OBJECT (obj), i);
+ if (atk_object_get_role (child) == ATK_ROLE_HEADING)
+ summary = child;
+ }
+ return summary ? summary : NULL;
+}
+
+static void
+my_atk_table_set_column_header (AtkTable *obj, gint column, AtkObject *header)
+{
+}
+
+static void
+my_atk_table_set_column_description (AtkTable *obj, gint column, const gchar *desc)
+{
+}
+
+static void
+my_atk_table_set_caption (AtkTable *obj, AtkObject *caption)
+{
+}
+
+static void
+my_atk_table_set_row_description (AtkTable *obj, gint row, const gchar *desc)
+{
+}
+
+static void
+my_atk_table_set_row_header (AtkTable *obj, gint column, AtkObject *header)
+{
+}
+
+static void
+my_atk_table_set_summary (AtkTable *table, AtkObject *accessible)
+{
+}
+
+static void
+my_atk_table_row_inserted (AtkTable *table, gint row, gint num_inserted)
+{
+}
+
+static void
+my_atk_table_column_inserted (AtkTable *table, gint column, gint num_inserted)
+{
+}
+
+static void
+my_atk_table_row_deleted (AtkTable *table, gint row, gint num_deleted)
+{
+}
+
+static void
+my_atk_table_column_deleted (AtkTable *table, gint column, gint num_deleted)
+{
+}
+
+static void
+my_atk_table_row_reordered (AtkTable *table)
+{
+}
+
+static void
+my_atk_table_column_reordered (AtkTable *table)
+{
+}
+
+static void
+my_atk_table_model_changed (AtkTable *table)
+{
+}
+
+static void
+atk_table_interface_init (AtkTableIface *iface)
+{
+
+ if (!iface) return;
+
+ iface->ref_at = my_atk_table_ref_at;
+
+ /* DEPRICATED BUT NOT IN ATSPI */
+ iface->get_index_at = my_atk_table_get_index_at;
+ iface->get_column_at_index = my_atk_table_get_column_at_index;
+ iface->get_row_at_index = my_atk_table_get_row_at_index;
+ /* DEPRICATED */
+
+ iface->get_n_columns = my_atk_table_get_n_columns;
+ iface->get_n_rows = my_atk_table_get_n_rows;
+ iface->get_column_extent_at = my_atk_table_test_table_get_column_extent_at;
+ iface->get_row_extent_at = my_atk_table_test_table_get_row_extent_at;
+ iface->get_caption = my_atk_table_get_caption;
+ iface->get_column_description = my_atk_table_get_column_description;
+ iface->get_column_header = my_atk_table_get_column_header;
+ iface->get_row_description = my_atk_table_get_row_description;
+ iface->get_row_header = my_atk_table_get_row_header;
+ iface->get_summary = my_atk_table_get_summary;
+ iface->set_caption = my_atk_table_set_caption;
+ iface->set_column_description = my_atk_table_set_column_description;
+ iface->set_column_header = my_atk_table_set_column_header;
+ iface->set_row_description = my_atk_table_set_row_description;
+ iface->set_row_header = my_atk_table_set_row_header;
+ iface->set_summary = my_atk_table_set_summary;
+ iface->get_selected_columns = my_atk_table_get_selected_columns;
+ iface->get_selected_rows = my_atk_table_get_selected_rows;
+ iface->is_column_selected = my_atk_table_is_column_selected;
+ iface->is_row_selected = my_atk_table_is_row_selected;
+ iface->is_selected = my_atk_table_is_selected;
+ iface->add_row_selection = my_atk_table_add_row_selection;
+ iface->remove_row_selection = my_atk_table_remove_row_selection;
+ iface->add_column_selection = my_atk_table_add_column_selection;
+ iface->remove_column_selection = my_atk_table_remove_column_selection;
+ iface->row_inserted = my_atk_table_row_inserted;
+ iface->column_inserted = my_atk_table_column_inserted;
+ iface->row_deleted = my_atk_table_row_deleted;
+ iface->column_deleted = my_atk_table_column_deleted;
+ iface->row_reordered = my_atk_table_row_reordered;
+ iface->column_reordered = my_atk_table_column_reordered;
+ iface->model_changed = my_atk_table_model_changed;
+}
+
+static void
+my_atk_table_init (MyAtkTable *self)
+{
+ self->parent_table = NULL;
+ self->table = g_ptr_array_new_with_free_func (GDestroyNotifyGPTRARRAYptrArray);
+ self->row_header = g_ptr_array_new_with_free_func (GDestroyNotifyGPTRARRAYptrArray);
+ self->column_headers = g_ptr_array_new_with_free_func (GDestroyNotifyGPTRARRAYptrArray);
+ self->selected = FALSE;
+ self->col_desc = NULL;
+
+}
+
+static void
+GDestroyNotifyGPTRARRAYptrArray (gpointer data)
+{
+ g_ptr_array_free (data, TRUE);
+}
+
+static void
+my_atk_table_class_initialize (AtkObject *obj, gpointer data)
+{
+}
+
+static void
+my_atk_table_class_finalize (GObject *obj)
+{
+}
+
+static void
+my_atk_table_class_init (MyAtkTableClass *my_class)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS (my_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (my_class);
+
+ gobject_class->finalize = my_atk_table_class_finalize;
+
+ atk_class->initialize = my_atk_table_class_initialize;
+}
diff --git a/tests/dummyatk/my-atk-table.h b/tests/dummyatk/my-atk-table.h
new file mode 100644
index 0000000..a3a0e35
--- /dev/null
+++ b/tests/dummyatk/my-atk-table.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2008 Codethink Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MY_ATK_TABLE_H_
+#define MY_ATK_TABLE_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <atk/atk.h>
+
+#include "my-atk-object.h"
+#define MY_TYPE_ATK_TABLE (my_atk_table_get_type ())
+#define MY_ATK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_TABLE, MyAtkTable))
+#define MY_ATK_TABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_TABLE, MyAtkTableClass))
+#define MY_IS_ATK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_TABLE))
+#define MY_IS_ATK_TABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_TABLE))
+#define MY_ATK_TABLE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_TABLE, MyAtkTableClass))
+
+typedef struct _MyAtkTable MyAtkTable;
+typedef struct _MyAtkTableClass MyAtkTableClass;
+
+struct _MyAtkTable {
+ MyAtkObject parent;
+ MyAtkTable *parent_table;
+ GPtrArray *table;
+ GPtrArray *column_headers;
+ GPtrArray *row_headers;
+ GPtrArray *row_header;
+ gchar *col_desc;
+ gboolean selected;
+};
+
+struct _MyAtkTableClass {
+ MyAtkObjectClass parent;
+};
+
+GType my_atk_table_get_type (void);
+
+guint my_atk_set_table (AtkTable *obj,
+ gchar *col_header,
+ gchar *row_header,
+ gchar *col_desc,
+ gchar* row_desc,
+ gchar *value,
+ gboolean selected,
+ gboolean selected_col);
+
+AtkObject*
+test_get_cell_from_table (AtkTable *obj, gint row);
+
+#endif /* MY_ATK_TABLE_H_ */
diff --git a/tests/dummyatk/my-atk.h b/tests/dummyatk/my-atk.h
index eab8b8f..ef13273 100644
--- a/tests/dummyatk/my-atk.h
+++ b/tests/dummyatk/my-atk.h
@@ -26,9 +26,15 @@
#include "my-atk-action.h"
#include "my-atk-object.h"
#include "my-atk-component.h"
+#include "my-atk-document.h"
#include "my-atk-editable-text.h"
+#include "my-atk-hyperlink.h"
+#include "my-atk-hypertext.h"
#include "my-atk-image.h"
+#include "my-atk-table.h"
+#include "my-atk-table-cell.h"
#include "my-atk-text.h"
+#include "my-atk-selection.h"
#include "my-atk-value.h"
#endif /*MY_ATK_H*/