AtspiRelationType type;
int i;
if (source)
- {
- DEBUG("CHECKING RELATIONS");
- relations = atspi_accessible_get_relation_set(source, NULL);
- for (i = 0; i < relations->len; i++)
- {
- DEBUG("ALL RELATIONS FOUND: %d",relations->len);
- relation = g_array_index (relations, AtspiRelation*, i);
- type = atspi_relation_get_relation_type(relation);
- DEBUG("RELATION: %d",type);
-
- if (type == search_type)
- {
- ret = atspi_relation_get_target(relation, 0);
- DEBUG("SEARCHED RELATION FOUND");
- break;
- }
- }
+ {
+ DEBUG("CHECKING RELATIONS");
+ relations = atspi_accessible_get_relation_set(source, NULL);
+ for (i = 0; i < relations->len; i++)
+ {
+ DEBUG("ALL RELATIONS FOUND: %d",relations->len);
+ relation = g_array_index (relations, AtspiRelation*, i);
+ type = atspi_relation_get_relation_type(relation);
+ DEBUG("RELATION: %d",type);
+
+ if (type == search_type)
+ {
+ ret = atspi_relation_get_target(relation, 0);
+ DEBUG("SEARCHED RELATION FOUND");
+ break;
+ }
+ }
g_array_free(relations, TRUE);
- }
+ }
return ret;
}
DEBUG("Start is defunct!");
}
- AtspiAccessible *node = (start && start_is_not_defunct)
- ? g_object_ref(start)
- : (root ? g_object_ref(root) : NULL);
-
- if (!node) return NULL;
-
- AtspiAccessible *next_related_in_direction = (next_sibling_idx_modifier > 0)
- ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO)
- : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM);
-
- Eina_Bool relation_mode = EINA_FALSE;
- if (next_related_in_direction)
- {
- relation_mode = EINA_TRUE;
- g_object_unref(next_related_in_direction);
- }
-
- while (1)
- {
- AtspiAccessible *prev_related_in_direction = (next_sibling_idx_modifier > 0)
- ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM)
- : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO);
-
- if (node != start && (relation_mode || !prev_related_in_direction) && stop_condition(node))
- {
- g_object_unref(prev_related_in_direction);
- return node;
- }
-
- AtspiAccessible *next_related_in_direction = (next_sibling_idx_modifier > 0)
- ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO)
- : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM);
-
- DEBUG("RELATION MODE: %d",relation_mode);
- if (!prev_related_in_direction)
- DEBUG("PREV IN RELATION NULL");
- if (!next_related_in_direction)
- DEBUG("NEXT IN RELATION NULL");
-
-
- if ((!relation_mode && !prev_related_in_direction && next_related_in_direction) || (relation_mode && next_related_in_direction))
- {
- DEBUG("APPLICABLE FOR RELATION NAVIG");
- g_object_unref(prev_related_in_direction);
- relation_mode = EINA_TRUE;
- g_object_unref(node);
- node = next_related_in_direction;
- }
- else
- {
- g_object_unref(prev_related_in_direction);
- g_object_unref(next_related_in_direction);
- relation_mode = EINA_FALSE;
- int cc = atspi_accessible_get_child_count(node, NULL);
- if (cc > 0) // walk down
- {
- int idx = next_sibling_idx_modifier > 0 ? 0 : cc-1;
- g_object_unref(node);
- node = atspi_accessible_get_child_at_index (node,idx, NULL);
- DEBUG("DFS DOWN");
- }
- else
- {
- while (!_has_next_sibling(node, next_sibling_idx_modifier) || node==root) // no next sibling
- {
- DEBUG("DFS NO SIBLING");
- if (node == root)
- {
- DEBUG("DFS ROOT")
- g_object_unref(node);
- return NULL;
- }
- g_object_unref(node);
- node = atspi_accessible_get_parent(node, NULL); // walk up...
- DEBUG("DFS UP");
- }
- int idx = atspi_accessible_get_index_in_parent(node, NULL);
- g_object_unref(node);
- node = atspi_accessible_get_child_at_index(atspi_accessible_get_parent(node, NULL), idx + next_sibling_idx_modifier, NULL); //... and next
- DEBUG("DFS NEXT %d",idx + next_sibling_idx_modifier);
- }
- }
- }
+ AtspiAccessible *node = (start && start_is_not_defunct)
+ ? g_object_ref(start)
+ : (root ? g_object_ref(root) : NULL);
+
+ if (!node) return NULL;
+
+ AtspiAccessible *next_related_in_direction = (next_sibling_idx_modifier > 0)
+ ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO)
+ : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM);
+
+ Eina_Bool relation_mode = EINA_FALSE;
+ if (next_related_in_direction)
+ {
+ relation_mode = EINA_TRUE;
+ g_object_unref(next_related_in_direction);
+ }
+
+ while (1)
+ {
+ AtspiAccessible *prev_related_in_direction = (next_sibling_idx_modifier > 0)
+ ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM)
+ : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO);
+
+ if (node != start && (relation_mode || !prev_related_in_direction) && stop_condition(node))
+ {
+ g_object_unref(prev_related_in_direction);
+ return node;
+ }
+
+ AtspiAccessible *next_related_in_direction = (next_sibling_idx_modifier > 0)
+ ? _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO)
+ : _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM);
+
+ DEBUG("RELATION MODE: %d",relation_mode);
+ if (!prev_related_in_direction)
+ DEBUG("PREV IN RELATION NULL");
+ if (!next_related_in_direction)
+ DEBUG("NEXT IN RELATION NULL");
+
+
+ if ((!relation_mode && !prev_related_in_direction && next_related_in_direction) || (relation_mode && next_related_in_direction))
+ {
+ DEBUG("APPLICABLE FOR RELATION NAVIG");
+ g_object_unref(prev_related_in_direction);
+ relation_mode = EINA_TRUE;
+ g_object_unref(node);
+ node = next_related_in_direction;
+ }
+ else
+ {
+ g_object_unref(prev_related_in_direction);
+ g_object_unref(next_related_in_direction);
+ relation_mode = EINA_FALSE;
+ int cc = atspi_accessible_get_child_count(node, NULL);
+ if (cc > 0) // walk down
+ {
+ int idx = next_sibling_idx_modifier > 0 ? 0 : cc-1;
+ g_object_unref(node);
+ node = atspi_accessible_get_child_at_index (node,idx, NULL);
+ DEBUG("DFS DOWN");
+ }
+ else
+ {
+ while (!_has_next_sibling(node, next_sibling_idx_modifier) || node==root) // no next sibling
+ {
+ DEBUG("DFS NO SIBLING");
+ if (node == root)
+ {
+ DEBUG("DFS ROOT")
+ g_object_unref(node);
+ return NULL;
+ }
+ g_object_unref(node);
+ node = atspi_accessible_get_parent(node, NULL); // walk up...
+ DEBUG("DFS UP");
+ }
+ int idx = atspi_accessible_get_index_in_parent(node, NULL);
+ g_object_unref(node);
+ node = atspi_accessible_get_child_at_index(atspi_accessible_get_parent(node, NULL), idx + next_sibling_idx_modifier, NULL); //... and next
+ DEBUG("DFS NEXT %d",idx + next_sibling_idx_modifier);
+ }
+ }
+ }
}
AtspiAccessible *_first(FlatNaviContext *ctx)
return ctx->root;
}
+const AtspiAccessible *flat_navi_context_first_get(FlatNaviContext *ctx)
+{
+ if(!ctx) return NULL;
+
+ return _first(ctx);
+}
+
+const AtspiAccessible *flat_navi_context_last_get(FlatNaviContext *ctx)
+{
+ if(!ctx) return NULL;
+
+ return _last(ctx);
+}
+
AtspiAccessible *flat_navi_context_current_get(FlatNaviContext *ctx)
{
if(!ctx) return NULL;
if(!obj)
{
+ DEBUG("obj == NULL");
s_auto_review.auto_review_on = false;
return;
}
+ else if(obj == flat_navi_context_last_get(context))
+ {
+ DEBUG("obj == flat_navi_context_last_get()");
+ s_auto_review.auto_review_on = false;
+ }
+
_current_highlight_object_set(obj);
AtspiAction *_get_main_window(void)
{
AtspiAccessible *win = flat_navi_context_root_get(context);
- if (!win) {
- ERROR("win == NULL");
- return NULL;
- }
+ if (!win)
+ {
+ ERROR("win == NULL");
+ return NULL;
+ }
AtspiAction *action = atspi_accessible_get_action_iface(win);
- if (!action) {
- ERROR("action == NULL");
- return NULL;
- }
+ if (!action)
+ {
+ ERROR("action == NULL");
+ return NULL;
+ }
return action;
}
char *action_name = "pause_play";
AtspiAction *action = _get_main_window();
if(!action)
- {
- ERROR("Could not get the action inteface");
- }
+ {
+ ERROR("Could not get the action inteface");
+ }
if(!action)
{
action_index = _find_action_index(action, action_name);
if(action_index < 0)
- {
- ERROR("Pause_play action not found");
- return;
- }
+ {
+ ERROR("Pause_play action not found");
+ return;
+ }
DEBUG("ACTION: %s has index: %d", action_name, action_index);
atspi_action_do_action(action, action_index, NULL);
atspi_state_set_add (states, ATSPI_STATE_MODAL);
DEBUG("GET MODAL: STATE SET PREPARED");
AtspiMatchRule *rule = atspi_match_rule_new (states,
- ATSPI_Collection_MATCH_ANY,
- NULL,
- ATSPI_Collection_MATCH_INVALID,
- NULL,
- ATSPI_Collection_MATCH_INVALID,
- NULL,
- ATSPI_Collection_MATCH_INVALID,
- 0);
+ ATSPI_Collection_MATCH_ANY,
+ NULL,
+ ATSPI_Collection_MATCH_INVALID,
+ NULL,
+ ATSPI_Collection_MATCH_INVALID,
+ NULL,
+ ATSPI_Collection_MATCH_INVALID,
+ 0);
DEBUG("GET MODAL: MATCHING RULE PREPARED");
AtspiAccessible *ret = NULL;
AtspiCollection *col_iface = atspi_accessible_get_collection_iface(root);
GArray *result = atspi_collection_get_matches (col_iface,
- rule,
- ATSPI_Collection_SORT_ORDER_INVALID,
- 1,
- 1,
- &err);
+ rule,
+ ATSPI_Collection_SORT_ORDER_INVALID,
+ 1,
+ 1,
+ &err);
GERROR_CHECK(err);
DEBUG("GET MODAL: QUERY PERFORMED");
g_object_unref(states);
g_object_unref(rule);
g_object_unref(col_iface);
if (result && result->len > 0)
- {
- DEBUG("GET MODAL: MODAL FOUND");
- g_array_set_clear_func(result, clear);
- ret = g_object_ref(g_array_index(result, AtspiAccessible*, 0));
- g_array_free(result, TRUE);
- }
+ {
+ DEBUG("GET MODAL: MODAL FOUND");
+ g_array_set_clear_func(result, clear);
+ ret = g_object_ref(g_array_index(result, AtspiAccessible*, 0));
+ g_array_free(result, TRUE);
+ }
return ret;
}
app_tracker_callback_unregister(top_window, _view_content_changed, NULL);
if (window)
- {
- DEBUG("Window name: %s", atspi_accessible_get_name(window, NULL));
- app_tracker_callback_register(window, _view_content_changed, NULL);
- // TODO: modal descendant of window should be used (if exists) otherwise window
- AtspiAccessible *modal_descendant = _get_modal_descendant(window);
- _view_content_changed(modal_descendant ? modal_descendant : window, NULL);
- g_object_unref(modal_descendant);
- }
+ {
+ DEBUG("Window name: %s", atspi_accessible_get_name(window, NULL));
+ app_tracker_callback_register(window, _view_content_changed, NULL);
+ // TODO: modal descendant of window should be used (if exists) otherwise window
+ AtspiAccessible *modal_descendant = _get_modal_descendant(window);
+ _view_content_changed(modal_descendant ? modal_descendant : window, NULL);
+ g_object_unref(modal_descendant);
+ }
else
- {
- flat_navi_context_free(context);
- ERROR("No top window found!");
- }
+ {
+ flat_navi_context_free(context);
+ ERROR("No top window found!");
+ }
top_window = window;
DEBUG("END");
}