+static void _print_horizontal_line_in_actions_table() {
+ int size_factor = 1;
+ for (int i = 0; i < ACTIONS_TABLE_COLUMN_COUNT; i++) {
+ if (i == ACTIONS_TABLE_COLUMN_COUNT - 1)
+ size_factor = 4;
+ for (int j = 0; j < ACTIONS_TABLE_BASE_COLUMN_WIDTH * size_factor; j++)
+ printf("-");
+ printf("+");
+ }
+ printf("\n");
+}
+
+static void _print_actions_for_object(AtspiAccessible *node) {
+ char *unique_id = atspi_accessible_get_unique_id(node, NULL);
+ AtspiAction* action_if = atspi_accessible_get_action_iface (node);
+ if (action_if) {
+ gint no_actions = atspi_action_get_n_actions (action_if, NULL);
+ for (int i=0; i< no_actions; i++) {
+ gchar * ith_action = atspi_action_get_action_name (action_if, i, NULL);
+ printf("%*s|", ACTIONS_TABLE_BASE_COLUMN_WIDTH, unique_id ? unique_id : "");
+ printf("%*s|\n", ACTIONS_TABLE_BASE_COLUMN_WIDTH * 4, ith_action ? (char *) ith_action : "");
+ g_free(ith_action);
+ }
+ _print_horizontal_line_in_actions_table();
+ }
+ free(unique_id);
+}
+
+static void _print_actions_for_objects_in_tree(AtspiAccessible *node) {
+ _iterate_over_tree(_print_actions_for_object, node);
+}
+
+static void _print_header_for_actions_table() {
+ char *table[] = {"OBJECT", "SUPPORTED ACTION"};
+ assert(ARRAY_SIZE(table) == ACTIONS_TABLE_COLUMN_COUNT);
+
+ _print_horizontal_line_in_actions_table();
+
+ int size_factor = 1;
+ for (int i = 0; i < ACTIONS_TABLE_COLUMN_COUNT; i++) {
+ if (i == ACTIONS_TABLE_COLUMN_COUNT - 1)
+ size_factor = 4;
+ printf("%*s|", ACTIONS_TABLE_BASE_COLUMN_WIDTH * size_factor , table[i]);
+ }
+
+ printf("\n");
+ _print_horizontal_line_in_actions_table();
+}
+
+static void _print_actions_table(AtspiAccessible *node) {
+ printf("\nSUPPPORTED ACTIONS TABLE\n");
+ _print_header_for_actions_table();
+ _print_actions_for_objects_in_tree(node);
+}
+