/**
* @brief Callback
*/
-typedef void (*AppTrackerEventCB)(void *user_data);
+typedef void (*AppTrackerEventCB)(AtspiAccessible *root, void *user_data);
/**
* @brief Register listener on given event type.
*/
AtspiAccessible *flat_navi_context_first_get(FlatNaviContext *ctx);
+
+Eina_Bool flat_navi_is_valid(FlatNaviContext *context, AtspiAccessible *new_root);
+
#endif /* end of include guard: FLAT_NAVI_H_ */
+++ /dev/null
-#ifndef SMART_NAVI_OBJECT_CACHE_H_H
-#define SMART_NAVI_OBJECT_CACHE_H_H
-
-#include <atspi/atspi.h>
-
-typedef struct
-{
- // Boundaries of object taken from atspi_component_get_extents function.
- // NULL if object do not implemetn AtspiComponent interface
- AtspiRect *bounds;
-} ObjectCache;
-
-typedef void (*ObjectCacheReadyCb)(void *data);
-
-/**
- * @brief Recursivly build ObjectCache structures for ever Accessible
- * object from root and its all descendants.
- *
- * @param root starting object.
- * @param bulk_size Ammount of AtspiAccessible that will be cached on every
- * ecore_main_loop entering into 'idle' state.
- * @param cb function to be called after creating cache is done.
- * @param user_data passed to cb
- *
- * @remarks Flushes all previously cached items.
- */
-void object_cache_build_async(AtspiAccessible *root, int bulk_size, ObjectCacheReadyCb cb, void *user_data);
-
-/**
- * @brief Gets and ObjectCache item from accessible object
- *
- * @param obj AtspiAccessible
- *
- * @remarks If obj is not in cache function will block main loop and build ObjectCache
- * struct.
- */
-const ObjectCache *object_cache_get(AtspiAccessible *obj);
-
-/**
- * @brief Shoutdown cache.
- *
- * Function will free all gathered caches.
- *
- * @remarks Use it after You have used any of above object_cache_* functions.
- */
-void object_cache_shutdown(void);
-
-#endif /* end of include guard: OBJECT_CACHE_H_H */
+++ /dev/null
-#ifndef SMART_NAVI_POSITION_SORT_H_
-#define SMART_NAVI_POSITION_SORT_H_
-
-#include <atspi/atspi.h>
-#include <Eina.h>
-
-
-/**
- * @brief Sort objects by position they appear on screen
- *
- * example:
- *
- * ------------------------------
- * | _______ |
- * | _______ | | |
- * | | | ______ | | |
- * | | A | | | | | |
- * | |_____| | B | | C | |
- * | | | | | |
- * | |____| | | |
- * | _____ | | | line 0: A, B, C
- * | | | |_____| | line 1: D
- * | | D | | ====> line 2: F
- * | |___| _____ | line 3: G
- * | | | |
- * | | F | _____ |
- * | |___| | | |
- * | | G | |
- * | |___| |
- * | |
- * ------------------------------
- *
- * @ret list List of lists
- */
-Eina_List *position_sort(const Eina_List *obj);
-
-#endif /* end of include guard: POSITION_SORT_H_ */
+++ /dev/null
-#ifndef SMART_NAVI_STRUCTURAL_NAVI_H
-#define SMART_NAVI_STRUCTURAL_NAVI_H_
-
-#include <atspi/atspi.h>
-
-/**
- * @brief Structural navigation submodule.
- *
- * @detail
- * Structural navigation submodule can be used to traverse at-spi object tree
- * hierarchy in unified, position sorted manner.
- */
-
-/**
- * @brief Gets next Accessible object in "structural navigation" hierarchy.
- *
- * @detail
- * Gest next sibling object in accessibile objects tree which is considered as
- * next by taking into account its position on screen. (see @position_sort for
- * more details about visuall sorting)
- *
- * @param current AtspiAccessible instance from which sibling object will be
- * searched.
- *
- * @retun 'Next' AtspiAccessible object pointer or NULL if not found.
- */
-AtspiAccessible *structural_navi_same_level_next(AtspiAccessible *current);
-
-/**
- * @brief Gets previous Accessible object in "structural navigation" hierarchy.
- *
- * @detail
- * Gest previous sibling object in accessibile objects tree which is considered as
- * previous by taking into account its position on screen. (see @position_sort for
- * more details about visuall sorting)
- *
- * @param current AtspiAccessible instance from which sibling object will be
- * searched.
- *
- * @retun 'Previous' AtspiAccessible object pointer or NULL if not found.
- */
-AtspiAccessible *structural_navi_same_level_prev(AtspiAccessible *current);
-
-/**
- * @brief Gests parent's object.
- *
- * @detail
- * Gets parent object contained within same application. If there is no parent
- * object contained in same application function should return NULL.
- *
- * @param object AtspiAccessible which parent will be searched.
- * @return Parent AtspiAccessible object or NULL if not found or @current
- * is an application object.
- */
-AtspiAccessible *structural_navi_level_up(AtspiAccessible *current);
-
-/**
- * @brief Gets child object.
- *
- * @detail
- * Gets AtspiAccessible object considered as first child in structural
- * navigation hierachy. Child will be sorted by its position on the screen.
- * (see @position_sort for more details)
- *
- * @param object AtspiAccessible which child will be searched.
- * @return child AtspiAccessible object or NULL if not found.
- */
-AtspiAccessible *structural_navi_level_down(AtspiAccessible *current);
-
-/**
- * @brief Gets next object.
- *
- * @detail
- * Get next AtspiAccessible object from Atspi realation FLOWS_TO.
- *
- * @param object AtspiAccessible
- * @return next AtspiAccessible object or NULL if not found.
- */
-AtspiAccessible *structural_navi_app_chain_next(AtspiAccessible *current);
-
-/**
- * @brief Gets previous object.
- *
- * @detail
- * Get previous AtspiAccessible object from Atspi realation FLOWS_FROM.
- *
- * @param object AtspiAccessible
- * @return next AtspiAccessible object or NULL if not found.
- */
-AtspiAccessible *structural_navi_app_chain_prev(AtspiAccessible *current);
-
-#endif /* end of include guard: STRUCTURAL_NAVI_H_ */
-e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
-e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%'
export LD_LIBRARY_PATH=/emul/ia32-linux/lib:/emul/ia32-linux/usr/lib:$LD_LIBRARY_PATH
-make test
+#make test
%install
rm -rf %{buildroot}
typedef struct
{
+ AtspiAccessible *base_root;
AtspiAccessible *root;
GList *callbacks;
guint timer;
typedef struct
{
AppTrackerEventCB func;
+ AtspiAccessible *root;
void *user_data;
} EventCallbackData;
#endif
}
+
+static Eina_Bool _object_has_modal_state(AtspiAccessible *obj)
+{
+ if (!obj)
+ return EINA_FALSE;
+
+ Eina_Bool ret = EINA_FALSE;
+
+ AtspiStateSet *ss = atspi_accessible_get_state_set(obj);
+
+ if (atspi_state_set_contains(ss, ATSPI_STATE_MODAL))
+ ret = EINA_TRUE;
+ g_object_unref(ss);
+ return ret;
+}
+
+static Eina_Bool _object_has_showing_state(AtspiAccessible *obj)
+{
+ if (!obj)
+ return EINA_FALSE;
+
+ Eina_Bool ret = EINA_FALSE;
+
+ AtspiStateSet *ss = atspi_accessible_get_state_set(obj);
+
+ if (atspi_state_set_contains(ss, ATSPI_STATE_SHOWING))
+ ret = EINA_TRUE;
+ g_object_unref(ss);
+ return ret;
+}
+
static void
_subtree_callbacks_call(SubTreeRootData *std)
{
for (l = std->callbacks; l != NULL; l = l->next)
{
ecd = l->data;
- ecd->func(ecd->user_data);
+ ecd->func(std->root, ecd->user_data);
}
DEBUG("END");
}
DEBUG("END");
return FALSE;
}
+static void _print_event_object_info(const AtspiEvent *event)
+{
+ gchar *name = atspi_accessible_get_name(event->source, NULL),
+ *role = atspi_accessible_get_role_name(event->source, NULL);
+
+ DEBUG("signal:%s, name: %s, role: %s, detail1:%i, detail2: %i", event->type, role, name, event->detail1, event->detail2);
+ g_free(name);
+ g_free(role);
+}
static void
_on_atspi_event_cb(const AtspiEvent *event)
return;
}
- DEBUG("signal:%s", event->type);
+ _print_event_object_info(event);
for (l = _roots; l != NULL; l = l->next)
{
std = l->data;
+
+ if (!_object_has_showing_state(std->root) && std->base_root)
+ {
+ std->root = std->base_root;
+ std->base_root = NULL;
+ }
+
if (_is_descendant(std->root, event->source))
{
if (std->timer)
g_source_remove(std->timer);
+ DEBUG("Before Checking if modal is showing");
+
+ if (!strcmp("object:state-changed:showing",event->type))
+ {
+
+ DEBUG("Object is showing");
+
+ if (_object_has_modal_state(event->source))
+ {
+ DEBUG("Object is modal");
+
+ std->base_root = std->root;
+ std->root = event->source;
+ }
+ }
std->timer = g_timeout_add(APP_TRACKER_INVACTIVITY_TIMEOUT, _on_timeout_cb, std);
}
}
atspi_event_listener_register(_listener, "object:state-changed:showing", NULL);
atspi_event_listener_register(_listener, "object:state-changed:visible", NULL);
+ atspi_event_listener_register(_listener, "object:state-changed:defunct", NULL);
atspi_event_listener_register(_listener, "object:bounds-changed", NULL);
atspi_event_listener_register(_listener, "object:visible-data-changed", NULL);
atspi_event_listener_deregister(_listener, "object:state-changed:showing", NULL);
atspi_event_listener_deregister(_listener, "object:state-changed:visible", NULL);
atspi_event_listener_deregister(_listener, "object:bounds-changed", NULL);
- atspi_event_listener_deregister(_listener, "object:children-changed", NULL);
+ atspi_event_listener_deregister(_listener, "object:state-changed:defunct", NULL);
atspi_event_listener_deregister(_listener, "object:visible-data-changed", NULL);
g_object_unref(_listener);
{
rd = g_new(SubTreeRootData, 1);
rd->root = app;
+ rd->base_root = NULL;
rd->callbacks = NULL;
rd->timer = 0;
_roots = g_list_append(_roots, rd);
for (l = _roots; l != NULL; l = l->next)
{
- if (((SubTreeRootData*)l->data)->root == app)
+ if (((SubTreeRootData*)l->data)->root == app || ((SubTreeRootData*)l->data)->base_root == app)
{
std = l->data;
break;
#include "flat_navi.h"
-#include "position_sort.h"
-#include "object_cache.h"
#include "logger.h"
struct _FlatNaviContext
{
AtspiAccessible *root;
- Eina_List *current;
- Eina_List *current_line;
- Eina_List *lines;
- Eina_List *candidates;
+ AtspiAccessible *current;
+ AtspiAccessible *first;
+ AtspiAccessible *last;
+ AtspiAccessible *prev;
};
static const AtspiStateType required_states[] =
ATSPI_ROLE_LAST_DEFINED
};
-/**
- * @brief Returns a list of all descendants objects
- *
- * @return Eina_List of AtspiAccessible* type. List Should be
- * be free with _accessible_list_free after usage
- *
- * @note obj parameter will also be included (in list head)
- * @note every obj has increased ref. call g_object_unref on every
- * object after usage.
- */
-static Eina_List*
-_descendants_list_get(AtspiAccessible *obj)
-{
- Eina_List *ret = NULL, *toprocess = NULL;
- int i;
-
- if (!obj) return NULL;
-
- // to keep all refcounts in ret list +1
- g_object_ref(obj);
- toprocess = eina_list_append(toprocess, obj);
-
- while (toprocess)
- {
- AtspiAccessible *obj = eina_list_data_get(toprocess);
- toprocess = eina_list_remove_list(toprocess, toprocess);
- int n = atspi_accessible_get_child_count(obj, NULL);
- for (i = 0; i < n; i++)
- {
- AtspiAccessible *child = atspi_accessible_get_child_at_index(obj, i, NULL);
- if (child) toprocess = eina_list_append(toprocess, child);
- }
-
- ret = eina_list_append(ret, obj);
- }
-
- return ret;
-}
-
-static void
-_accessible_list_free(Eina_List *d)
-{
- AtspiAccessible *obj;
-
- EINA_LIST_FREE(d, obj)
- {
- g_object_unref(obj);
- }
-}
-
-typedef struct
-{
- Eina_List *success;
- Eina_List *failure;
-} FilterResult;
-
-static FilterResult
-_accessible_list_split_with_filter(Eina_List *list, Eina_Each_Cb cb, void *user_data)
-{
- FilterResult ret = { NULL, NULL};
- Eina_List *l, *ln;
- AtspiAccessible *obj;
-
- EINA_LIST_FOREACH_SAFE(list, l, ln, obj)
- {
- Eina_Bool res = cb(NULL, user_data, obj);
- if (res)
- eina_list_move_list(&ret.success, &list, l);
- else
- eina_list_move_list(&ret.failure, &list, l);
- }
-
- return ret;
-}
-
-static Eina_Bool
-_obj_state_visible_and_showing(AtspiAccessible *obj, Eina_Bool for_parent)
-{
- if (!obj) return EINA_FALSE;
- Eina_Bool ret = EINA_FALSE;
- AtspiStateSet *ss = NULL;
- AtspiAccessible *parent = NULL;
- if (!for_parent)
- ss = atspi_accessible_get_state_set(obj);
- else
- {
- parent = atspi_accessible_get_parent(obj, NULL);
- if (parent)
- ss = atspi_accessible_get_state_set(parent);
- }
- if (ss)
- {
- if (atspi_state_set_contains(ss, ATSPI_STATE_SHOWING)
- && atspi_state_set_contains(ss, ATSPI_STATE_VISIBLE))
- {
- ret = EINA_TRUE;
- }
- g_object_unref(ss);
- }
- if (parent) g_object_unref(parent);
- return ret;
-
-}
-
static Eina_Bool
_has_escape_action(AtspiAccessible *obj)
{
int i = 0;
for (; i < atspi_action_get_n_actions(action, NULL); i++)
{
- if (!strcmp(atspi_action_get_action_name(action, i, NULL), "escape"))
+ gchar *action_name = atspi_action_get_action_name(action, i, NULL);
+ Eina_Bool equal = !strcmp(action_name, "escape");
+ g_free(action_name);
+ if (equal)
{
ret = EINA_TRUE;
break;
}
static Eina_Bool
-_no_need_for_focusable_state(AtspiAccessible *obj)
+_is_collapsed(AtspiStateSet *ss)
{
- AtspiRole role = atspi_accessible_get_role(obj, NULL);
+ if (!ss)
+ return EINA_FALSE;
- switch (role)
- {
- case ATSPI_ROLE_LIST_ITEM:
- if (_obj_state_visible_and_showing(obj, EINA_TRUE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_MENU_ITEM:
- if (_obj_state_visible_and_showing(obj, EINA_TRUE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_PROGRESS_BAR:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_CALENDAR:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_LABEL:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_PUSH_BUTTON:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_POPUP_MENU:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- case ATSPI_ROLE_DIALOG:
- if (_obj_state_visible_and_showing(obj, EINA_FALSE))
- return EINA_TRUE;
- break;
- default:
- return EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ if (atspi_state_set_contains(ss, ATSPI_STATE_EXPANDABLE) && !atspi_state_set_contains(ss, ATSPI_STATE_EXPANDED))
+ ret = EINA_TRUE;
- }
- return EINA_FALSE;
+ return ret;
}
static Eina_Bool
-_filter_state_cb(const void *container, void *data, void *fdata)
+_object_is_item(AtspiAccessible *obj)
{
- AtspiStateType *state = data;
+ if (!obj)
+ return EINA_FALSE;
+
+ Eina_Bool ret = EINA_FALSE;
+ AtspiRole role = atspi_accessible_get_role(obj, NULL);
+ if (role == ATSPI_ROLE_LIST_ITEM || role == ATSPI_ROLE_MENU_ITEM)
+ ret = EINA_TRUE;
+ DEBUG("IS ITEM %d", ret);
+ return ret;
+}
+
+static Eina_Bool
+_accept_object(AtspiAccessible *obj)
+{
+ DEBUG("START");
+ if (!obj) return EINA_FALSE;
- Eina_Bool ret = EINA_TRUE;
- AtspiAccessible *obj = fdata;
+ Eina_Bool ret = EINA_FALSE;
+ gchar *name = NULL;
+ gchar *desc = NULL;
+ AtspiAction *action = NULL;
+ AtspiEditableText *etext = NULL;
+ AtspiText *text = NULL;
+ AtspiValue *value = NULL;
AtspiStateSet *ss = NULL;
- if (_no_need_for_focusable_state(obj))
- return EINA_TRUE;
+ AtspiRole r;
ss = atspi_accessible_get_state_set(obj);
- while (*state != ATSPI_STATE_LAST_DEFINED)
+ if (ss)
{
- if (!atspi_state_set_contains(ss, *state))
+ if (_object_is_item(obj))
+ {
+ AtspiAccessible *parent = atspi_accessible_get_parent(obj, NULL);
+ if (parent)
+ {
+ AtspiStateSet *pss = atspi_accessible_get_state_set(parent);
+ g_object_unref(parent);
+ if (pss)
+ {
+ ret = atspi_state_set_contains(pss, ATSPI_STATE_SHOWING) && atspi_state_set_contains(pss, ATSPI_STATE_VISIBLE) && !_is_collapsed(pss);
+ DEBUG("ITEM HAS SHOWING && VISIBLE && NOT COLLAPSED PARENT %d",ret);
+ g_object_unref(pss);
+ return ret;
+ }
+ }
+ }
+ else
{
- ret = EINA_FALSE;
- break;
+ ret = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING) && atspi_state_set_contains(ss, ATSPI_STATE_VISIBLE);
}
- state++;
+ g_object_unref(ss);
+ }
+ if (!ret)
+ {
+ return EINA_FALSE;
}
- if (ss)
- g_object_unref(ss);
- return ret;
-}
-static Eina_Bool
-_filter_role_cb(const void *container, void *data, void *fdata)
-{
- AtspiRole *role = data;
- Eina_Bool ret = EINA_FALSE;
- AtspiAccessible *obj = fdata;
+ r = atspi_accessible_get_role(obj, NULL);
+
+ switch(r) {
+ case ATSPI_ROLE_APPLICATION:
+ case ATSPI_ROLE_FILLER:
+ case ATSPI_ROLE_SCROLL_PANE:
+ case ATSPI_ROLE_SPLIT_PANE:
+ case ATSPI_ROLE_WINDOW:
+ case ATSPI_ROLE_IMAGE:
+ case ATSPI_ROLE_LIST:
+ case ATSPI_ROLE_PAGE_TAB_LIST:
+ case ATSPI_ROLE_TOOL_BAR:
+ return EINA_FALSE;
+ case ATSPI_ROLE_DIALOG:
+ if (!_has_escape_action(obj))
+ return EINA_FALSE;
+ break;
+ default:
+ break;
+ }
- while (*role != ATSPI_ROLE_LAST_DEFINED)
+ name = atspi_accessible_get_name(obj, NULL);
+
+ ret = EINA_FALSE;
+ if (strncmp(name, "\0", 1))
+ {
+ DEBUG("Has name:[%s]", name);
+ ret = EINA_TRUE;
+ }
+ g_free(name);
+ desc = atspi_accessible_get_description(obj, NULL);
+ if (!ret && strncmp(desc, "\0", 1))
+ {
+ DEBUG("Has description:[%s]", desc);
+ ret = EINA_TRUE;
+ }
+ g_free(desc);
+ if (!ret)
{
- if (atspi_accessible_get_role(obj, NULL) == *role)
+ action = atspi_accessible_get_action_iface(obj);
+ if (action)
{
+ DEBUG("Has action interface");
ret = EINA_TRUE;
- break;
+ g_object_unref(action);
}
- role++;
}
+ if (!ret)
+ {
+ value = atspi_accessible_get_value_iface(obj);
+ if (value)
+ {
+ DEBUG("Has value interface");
+ ret = EINA_TRUE;
+ g_object_unref(value);
+ }
+ }
+ if (!ret)
+ {
+ etext = atspi_accessible_get_editable_text_iface(obj);
+ if (etext)
+ {
+ DEBUG("Has editable text interface");
+ ret = EINA_TRUE;
+ g_object_unref(etext);
+ }
+ }
+ if (!ret)
+ {
+ text = atspi_accessible_get_text_iface(obj);
+ if (text)
+ {
+ DEBUG("Has text interface");
+ ret = EINA_TRUE;
+ g_object_unref(text);
+ }
+ }
+
+ DEBUG("END:%d", ret);
return ret;
}
-static Eina_Bool
-_filter_viewport_cb(const void *container, void *data, void *fdata)
+#ifdef SCREEN_READER_FLAT_NAVI_TEST_DUMMY_IMPLEMENTATION
+Eina_Bool flat_navi_context_current_at_x_y_set( FlatNaviContext *ctx, gint x_cord, gint y_cord , AtspiAccessible **target)
{
- const ObjectCache *oc = data;
- AtspiAccessible *obj = fdata;
-
- if (atspi_accessible_get_role(obj, NULL) == ATSPI_ROLE_LIST_ITEM)
- return EINA_TRUE;
-
- oc = object_cache_get(obj);
- if (!oc || !oc->bounds || (oc->bounds->height < 0) || (oc->bounds->width < 0))
- return EINA_FALSE;
-
- if (((oc->bounds->x + oc->bounds->width) < 0) || ((oc->bounds->y + oc->bounds->height) < 0))
- return EINA_FALSE;
-
- return EINA_TRUE;
+ return EINA_FALSE;
}
+#else
-static Eina_Bool
-_object_has_modal_state(AtspiAccessible *obj)
+int _object_has_modal_state(AtspiAccessible *obj)
{
if (!obj)
return EINA_FALSE;
return ret;
}
-static Eina_Bool
-_filter_ctx_popup_child_cb(const void *container, void *data, void *fdata)
-{
- DEBUG("START");
- AtspiAccessible *obj = fdata;
- AtspiRole role = atspi_accessible_get_role(obj, NULL);
-
- AtspiAccessible *first_modal_ancestor = _first_modal_object_in_object_chain(obj);
- Eina_Bool ret = (first_modal_ancestor && first_modal_ancestor != obj)
- || (role == ATSPI_ROLE_DIALOG && _has_escape_action(obj))
- || role == ATSPI_ROLE_POPUP_MENU;
- if (first_modal_ancestor)
- g_object_unref(first_modal_ancestor);
- return ret;
-}
-
-static Eina_List*
-_flat_review_candidates_get(AtspiAccessible *root)
-{
- Eina_List *desc, *ret = NULL;
- FilterResult fr0;
-
- desc = _descendants_list_get(root);
-
- DEBUG("All descendants: %d", eina_list_count(desc));
- Eina_List *l, *ln;
- AtspiAccessible *obj;
-
- AtspiRole role;
- gboolean with_ctx_popup = EINA_FALSE;
-
- // remove object that are not in root's viewport
-
- const ObjectCache *oc = object_cache_get(root);
- if (!oc || !oc->bounds || (oc->bounds->height < 0) || (oc->bounds->width < 0))
- {
- ERROR("Invalid root object bounds. Unable to filter descendants by position");
- fr0.success = desc;
- }
- else
- {
- fr0 = _accessible_list_split_with_filter(desc, _filter_viewport_cb, (void*)oc);
- _accessible_list_free(fr0.failure);
- }
-
- // remove objects without required states
- FilterResult fr1 = _accessible_list_split_with_filter(fr0.success, _filter_state_cb, (void*)required_states);
- _accessible_list_free(fr1.failure);
-
- // get 'interesting' objects
- FilterResult fr2 = _accessible_list_split_with_filter(fr1.success, _filter_role_cb, (void*)interesting_roles);
- ret = eina_list_merge(ret, fr2.success);
- _accessible_list_free(fr2.failure);
-
- DEBUG("Candidates after filters count: %d", eina_list_count(ret));
- EINA_LIST_FOREACH_SAFE(ret, l, ln, obj)
- {
- DEBUG("Name:[%s] Role:[%s]", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
- role = atspi_accessible_get_role(obj, NULL);
-
- if (role == ATSPI_ROLE_POPUP_MENU || role == ATSPI_ROLE_DIALOG)
- with_ctx_popup = EINA_TRUE;
- }
- if (with_ctx_popup)
- {
- with_ctx_popup = EINA_FALSE;
- FilterResult fr3 = _accessible_list_split_with_filter(ret, _filter_ctx_popup_child_cb, NULL);
- ret = fr3.success;
- _accessible_list_free(fr3.failure);
- }
-
- return ret;
-}
-
-static void
-debug(FlatNaviContext *ctx)
-{
- Eina_List *l1, *l2, *line;
- AtspiAccessible *obj;
- int i, l = 0;
-
- DEBUG("===============================");
- EINA_LIST_FOREACH(ctx->lines, l1, line)
- {
- i = 0;
- DEBUG("==== Line %d ====", l);
- EINA_LIST_FOREACH(line, l2, obj)
- {
- char *name = atspi_accessible_get_name(obj, NULL);
- char *role = atspi_accessible_get_role_name(obj, NULL);
- const ObjectCache *oc = object_cache_get(obj);
-
- if (oc)
- DEBUG("%d %s %s, (%d %d %d %d)", i++, name, role,
- oc->bounds->x, oc->bounds->y,
- oc->bounds->width, oc->bounds->height);
-
- if (name) g_free(name);
- if (role) g_free(role);
- }
- l++;
- }
- DEBUG("===============================");
-}
-
-static void _flat_navi_context_current_line_and_object_get(FlatNaviContext *ctx, AtspiAccessible *obj, Eina_List **current_line, Eina_List **current)
-{
- if(!ctx || !obj) return;
- Eina_List *l, *l2, *line;
- AtspiAccessible *tmp;
-
- EINA_LIST_FOREACH(ctx->lines, l, line)
- {
- EINA_LIST_FOREACH(line, l2, tmp)
- {
- if (tmp == obj)
- {
- *current_line = l;
- *current = l2;
- break;
- }
- }
- }
-}
-
-#ifdef SCREEN_READER_FLAT_NAVI_TEST_DUMMY_IMPLEMENTATION
-Eina_Bool flat_navi_context_current_at_x_y_set( FlatNaviContext *ctx, gint x_cord, gint y_cord , AtspiAccessible **target)
-{
- return EINA_FALSE;
-}
-#else
-
-static Eina_Bool _flat_navi_context_contains_object(FlatNaviContext *ctx, AtspiAccessible *obj)
-{
- if(!ctx || !obj) return EINA_FALSE;
-
- Eina_List *current_line = NULL, *current = NULL;
-
- _flat_navi_context_current_line_and_object_get(ctx, obj, ¤t_line, ¤t);
- return current_line != NULL;
-}
-
Eina_Bool flat_navi_context_current_at_x_y_set( FlatNaviContext *ctx, gint x_cord, gint y_cord , AtspiAccessible **target)
{
if(!ctx || !target) return EINA_FALSE;
else
DEBUG("Found modal object in ancestors chain");
- AtspiAccessible *obj_under_finger = NULL;
- AtspiAccessible *youngest_ancestor_in_context = (_flat_navi_context_contains_object(ctx, obj) ? g_object_ref(obj) : NULL);
+ AtspiAccessible *youngest_ancestor_in_context = (_accept_object(obj) ? g_object_ref(obj) : NULL);
AtspiComponent *component;
Eina_Bool look_for_next_descendant = EINA_TRUE;
- for(;look_for_next_descendant;) {
+ while(look_for_next_descendant) {
component = atspi_accessible_get_component_iface(obj);
- obj_under_finger = atspi_component_get_accessible_at_point(atspi_accessible_get_component_iface(obj),
+
+ g_object_unref(obj);
+ obj = component ? atspi_component_get_accessible_at_point(component,
x_cord,
y_cord,
ATSPI_COORD_TYPE_WINDOW,
&error
- );
+ ) : NULL;
g_clear_object(&component);
if (error)
error->domain, error->code, error->message);
g_clear_error(&error);
g_clear_object(&obj);
- g_clear_object(&obj_under_finger);
if (youngest_ancestor_in_context)
g_clear_object(&youngest_ancestor_in_context);
look_for_next_descendant = EINA_FALSE;
- } else if (obj_under_finger) {
- DEBUG("Found object %s, role %s", atspi_accessible_get_name(obj_under_finger, NULL), atspi_accessible_get_role_name(obj_under_finger, NULL));
- if (_flat_navi_context_contains_object(ctx, obj_under_finger))
+ } else if (obj) {
+ DEBUG("Found object %s, role %s", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
+ if (_accept_object(obj))
{
- DEBUG("Context contains object %s with role %s", atspi_accessible_get_name(obj_under_finger, NULL), atspi_accessible_get_role_name(obj_under_finger, NULL));
+ DEBUG("Object %s with role %s fulfills highlight conditions", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
if (youngest_ancestor_in_context)
g_object_unref(youngest_ancestor_in_context);
- youngest_ancestor_in_context = g_object_ref(obj_under_finger);
+ youngest_ancestor_in_context = g_object_ref(obj);
}
- g_object_unref(obj);
- obj = g_object_ref(obj_under_finger);
- g_clear_object(&obj_under_finger);
} else {
- obj_under_finger = g_object_ref(obj);
- g_object_unref(obj);
+ g_clear_object(&obj);
look_for_next_descendant = EINA_FALSE;
}
}
- if (obj_under_finger)
- g_clear_object(&obj_under_finger);
-
if (youngest_ancestor_in_context && !_object_has_modal_state(youngest_ancestor_in_context))
{
if (youngest_ancestor_in_context == current_obj ||
else
DEBUG("NO widget under (%d, %d) found or the same widget under hover",
x_cord, y_cord);
-
DEBUG("END");
return ret;
}
#endif
+
+AtspiAccessible *_get_child(AtspiAccessible *obj, int i)
+{
+ DEBUG("START:%d", i);
+ if (i<0)
+ {
+ DEBUG("END");
+ return NULL;
+ }
+ if (!obj)
+ {
+ DEBUG("END");
+ return NULL;
+ }
+ int cc = atspi_accessible_get_child_count(obj, NULL);
+ if (cc == 0 || i>=cc)
+ {
+ DEBUG("END");
+ return NULL;
+ }
+ return atspi_accessible_get_child_at_index (obj, i, NULL);
+}
+
+static Eina_Bool _has_next_sibling(AtspiAccessible *obj, int next_sibling_idx_modifier)
+{
+ Eina_Bool ret = EINA_FALSE;
+ int idx = atspi_accessible_get_index_in_parent(obj, NULL);
+ if (idx >= 0)
+ {
+ AtspiAccessible *parent = atspi_accessible_get_parent(obj, NULL);
+ int cc = atspi_accessible_get_child_count(parent, NULL);
+ g_object_unref(parent);
+ if ((next_sibling_idx_modifier > 0 && idx < cc-1) || (next_sibling_idx_modifier < 0 && idx > 0))
+ {
+ ret = EINA_TRUE;
+ }
+ }
+ return ret;
+}
+
+AtspiAccessible * _directional_depth_first_search(AtspiAccessible *root, AtspiAccessible *start, int next_sibling_idx_modifier, Eina_Bool (*stop_condition)(AtspiAccessible*))
+{
+ Eina_Bool start_is_not_defunct = EINA_FALSE;
+ if (start)
+ {
+ AtspiStateSet *ss = atspi_accessible_get_state_set(start);
+ start_is_not_defunct = !atspi_state_set_contains(ss, ATSPI_STATE_DEFUNCT);
+ g_object_unref(ss);
+ if (!start_is_not_defunct)
+ 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;
+ while (1)
+ {
+ if (node != start && stop_condition(node))
+ {
+ return node;
+ }
+
+ 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)
+{
+ DEBUG("START");
+ return _directional_depth_first_search(ctx->root, NULL, 1, &_accept_object);
+}
+
+AtspiAccessible *_last(FlatNaviContext *ctx)
+{
+ DEBUG("START");
+ return _directional_depth_first_search(ctx->root, NULL, -1, &_accept_object);
+}
+
+AtspiAccessible *_next(FlatNaviContext *ctx)
+{
+ DEBUG("START");
+ AtspiAccessible *root = ctx->root;
+ AtspiAccessible *current = ctx->current;
+ AtspiAccessible *ret = NULL;
+
+ ret = _directional_depth_first_search(root, current, 1, &_accept_object);
+
+ if (current && !ret)
+ {
+ DEBUG("DFS SECOND PASS");
+ ret = _directional_depth_first_search(root, NULL, 1, &_accept_object);
+ }
+ return ret;
+}
+
+AtspiAccessible *_prev(FlatNaviContext *ctx)
+{
+ DEBUG("START\n");
+ AtspiAccessible *root = ctx->root;
+ AtspiAccessible *current = ctx->current;
+ AtspiAccessible *ret = NULL;
+
+ ret = _directional_depth_first_search(root, current, -1, &_accept_object);
+ if (current && !ret)
+ {
+ DEBUG("DFS SECOND PASS");
+ ret = _directional_depth_first_search(root, NULL, -1, &_accept_object);
+ }
+ return ret;
+}
+
+
int flat_navi_context_current_children_count_visible_get( FlatNaviContext *ctx)
{
if(!ctx) return -1;
-
int count = 0;
+/*
AtspiAccessible *obj = NULL;
AtspiStateSet *ss = NULL;
g_object_unref(ss);
}
}
+*/
return count;
-
}
FlatNaviContext *flat_navi_context_create(AtspiAccessible *root)
{
+ DEBUG("START");
+ if (!root) return NULL;
FlatNaviContext *ret;
ret = calloc(1, sizeof(FlatNaviContext));
if (!ret) return NULL;
ret->root = root;
- ret->candidates = _flat_review_candidates_get(root);
- ret->lines = position_sort(ret->candidates);
- ret->current_line = ret->lines;
- ret->current = eina_list_data_get(ret->current_line);
-
- debug(ret);
-
+ ret->prev = NULL;
+ ret->current = _first(ret);
return ret;
}
void flat_navi_context_free(FlatNaviContext *ctx)
{
if (!ctx) return;
- Eina_List *l;
- EINA_LIST_FREE(ctx->lines, l)
- {
- eina_list_free(l);
- }
- _accessible_list_free(ctx->candidates);
free(ctx);
}
{
if(!ctx) return NULL;
- return eina_list_data_get(ctx->current);
+ return ctx->current;
}
Eina_Bool flat_navi_context_current_set(FlatNaviContext *ctx, AtspiAccessible *target)
{
if(!ctx || !target) return EINA_FALSE;
- Eina_List *current_line = NULL, *current = NULL;
- _flat_navi_context_current_line_and_object_get(ctx, target, ¤t_line, ¤t);
- if (current_line) {
- ctx->current_line = current_line;
- ctx->current = current;
- }
- return current_line != NULL;
+ ctx->current = target;
+
+ return EINA_TRUE;
}
AtspiAccessible *flat_navi_context_next(FlatNaviContext *ctx)
{
if(!ctx) return NULL;
- Eina_List *ret = eina_list_next(ctx->current);
+ AtspiAccessible *ret = _next(ctx);
+ ctx->current = ret;
+
+ return ret;
- if (ret)
- {
- ctx->current = ret;
- return eina_list_data_get(ctx->current);
- }
- return NULL;
}
AtspiAccessible *flat_navi_context_prev(FlatNaviContext *ctx)
{
if(!ctx) return NULL;
- Eina_List *ret = eina_list_prev(ctx->current);
+ AtspiAccessible *ret = _prev(ctx);
+ ctx->current = ret;
- if (ret)
- {
- ctx->current = ret;
- return eina_list_data_get(ctx->current);
- }
- return NULL;
+ return ret;
}
AtspiAccessible *flat_navi_context_first(FlatNaviContext *ctx)
{
if(!ctx) return NULL;
- Eina_List *ret = eina_list_data_get(ctx->current_line);
+ AtspiAccessible *ret = _first(ctx);
+ ctx->current = ret;
- if (ret)
- {
- ctx->current = ret;
- return eina_list_data_get(ctx->current);
- }
- return NULL;
+ return ret;
}
AtspiAccessible *flat_navi_context_last(FlatNaviContext *ctx)
{
if(!ctx) return NULL;
- Eina_List *ret = eina_list_last(ctx->current);
-
- if (ret)
- {
- ctx->current = ret;
- return eina_list_data_get(ctx->current);
- }
- return NULL;
-}
-
-AtspiAccessible *flat_navi_context_line_next(FlatNaviContext *ctx)
-{
- if(!ctx) return NULL;
-
- Eina_List *ret = eina_list_next(ctx->current_line);
- if (!ret) return NULL;
-
- ctx->current_line = ret;
- ctx->current = eina_list_data_get(ctx->current_line);
-
- return eina_list_data_get(ctx->current);
-}
-
-AtspiAccessible *flat_navi_context_line_prev(FlatNaviContext *ctx)
-{
- if(!ctx) return NULL;
-
- Eina_List *ret = eina_list_prev(ctx->current_line);
- if (!ret) return NULL;
-
- ctx->current_line = ret;
- ctx->current = eina_list_data_get(ctx->current_line);
+ AtspiAccessible *ret = _last(ctx);
+ ctx->current = ret;
- return eina_list_data_get(ctx->current);
-}
-
-AtspiAccessible *flat_navi_context_line_first(FlatNaviContext *ctx)
-{
- if(!ctx) return NULL;
-
- Eina_List *ret = ctx->lines;
-
- ctx->current_line = ret;
- ctx->current = eina_list_data_get(ctx->current_line);
-
- return eina_list_data_get(ctx->current);
-}
-
-AtspiAccessible *flat_navi_context_line_last(FlatNaviContext *ctx)
-{
- if(!ctx) return NULL;
-
- Eina_List *ret = eina_list_last(ctx->current_line);
-
- ctx->current_line = ret;
- ctx->current = eina_list_data_get(ctx->current_line);
-
- return eina_list_data_get(ctx->current);
+ return ret;
}
-AtspiAccessible *flat_navi_context_first_get(FlatNaviContext *ctx)
+Eina_Bool flat_navi_is_valid(FlatNaviContext *context, AtspiAccessible *new_root)
{
- if(!ctx) return NULL;
- Eina_List *current = eina_list_data_get(ctx->lines);
+ Eina_Bool ret = EINA_FALSE;
+ if (!context || !context->current || context->root != new_root)
+ return ret;
+ AtspiStateSet *ss = atspi_accessible_get_state_set(context->current);
-
- return eina_list_data_get(current);
+ ret = atspi_state_set_contains(ss, ATSPI_STATE_SHOWING) && !atspi_state_set_contains(ss, ATSPI_STATE_DEFUNCT);
+ g_object_unref(ss);
+ return ret;
}
#include "window_tracker.h"
#include "keyboard_tracker.h"
#include "pivot_chooser.h"
-#include "structural_navi.h"
-#include "object_cache.h"
#include "flat_navi.h"
#include "app_tracker.h"
#include "smart_notification.h"
static AtspiAccessible *current_obj;
static AtspiComponent *current_comp = NULL;
static AtspiAccessible *top_window;
-//static AtspiScrollable *scrolled_obj;
-static Eina_Bool _window_cache_builded;
-static Eina_Bool _window_top_changed;
static FlatNaviContext *context;
static bool prepared = false;
static int counter=0;
return strdup("ATSPI_STATE_READ_ONLY");
case ATSPI_STATE_LAST_DEFINED:
return strdup("ATSPI_STATE_LAST_DEFINED");
-
+ case ATSPI_STATE_MODAL:
+ return strdup("ATSPI_STATE_MODAL");
default:
return strdup("\0");
}
DEBUG("DESCRIPTION:%s", description);
DEBUG("CHILDS:%d", atspi_accessible_get_child_count(obj, NULL));
DEBUG("HIGHLIGHT_INDEX:%d", atspi_component_get_highlight_index(comp, NULL));
+ DEBUG("INDEX IN PARENT:%d", atspi_accessible_get_index_in_parent(obj, NULL));
if (value)
{
DEBUG("VALUE:%f", atspi_value_get_current_value (value, NULL));
DEBUG(" %s", state_name);
free(state_name);
}
+ g_array_free(states, 0);
DEBUG("LOCALE:%s", atspi_accessible_get_object_locale(obj, NULL));
DEBUG("SIZE ON SCREEN, width:%d, height:%d",rect_screen->width, rect_screen->height);
DEBUG("POSITION ON SCREEN: x:%d y:%d", rect_screen->x, rect_screen->y);
{
DEBUG("START");
+ if (!obj)
+ return strdup("");
+ return strdup("");
+ /*
AtspiRole role;
int child_count;
int i;
char ret[TTS_MAX_TEXT_SIZE] = "\0";
AtspiAccessible *child = NULL;
- if (!obj)
- return strdup("");
+ int child_count = atspi_accessible_get_child_count(obj, NULL);
role = atspi_accessible_get_role(obj, NULL);
free(name);
}
return strdup(ret);
+ */
}
static int
DEBUG("START");
GError *err = NULL;
gchar *role = NULL;
- gchar *name = NULL;
- if (!context)
- return;
if (!obj)
{
DEBUG("Clearing highlight object");
current_obj = NULL;
+ if (current_comp)
+ {
+ atspi_component_clear_highlight(current_comp, &err);
+ g_object_ref(current_comp);
+ current_comp = NULL;
+ }
+
return;
}
if (current_obj == obj)
GERROR_CHECK(err)
current_obj = obj;
- const ObjectCache *oc = object_cache_get(obj);
- if (oc)
- {
- name = atspi_accessible_get_name(obj, &err);
- GERROR_CHECK(err)
- role = atspi_accessible_get_role_name(obj, &err);
- GERROR_CHECK(err)
- DEBUG("New highlighted object: %s, role: %s, (%d %d %d %d)",
- name,
- role,
- oc->bounds->x, oc->bounds->y, oc->bounds->width, oc->bounds->height);
- haptic_vibrate_start();
- g_free(name);
- g_free(role);
- }
- else
- {
- name = atspi_accessible_get_name(obj, &err);
- GERROR_CHECK(err)
- role = atspi_accessible_get_role_name(obj, &err);
- GERROR_CHECK(err)
- DEBUG("New highlighted object: %s, role: %s",
- name,
- role);
- haptic_vibrate_start();
- g_free(name);
- g_free(role);
- }
char *text_to_speak = NULL;
text_to_speak = generate_what_to_read(obj);
DEBUG("SPEAK:%s", text_to_speak);
}
}
-#if 0
-static void object_get_x_y(AtspiAccessible * accessibleObject, int* x, int* y)
-{
- GError * error = NULL;
-
- if ( ATSPI_IS_COMPONENT(accessibleObject) )
- {
- AtspiComponent * component = ATSPI_COMPONENT(accessibleObject);
- AtspiPoint *position = atspi_component_get_position (component, ATSPI_COORD_TYPE_SCREEN, &error);
- if ( error != NULL )
- {
- g_error_free(error);
- }
- if ( position != NULL )
- {
- *x = position->x;
- *y = position->y;
- g_free ( position );
- }
- }
-}
-
-static void object_get_wh(AtspiAccessible * accessibleObject, int* width, int* height)
-{
- GError * error = NULL;
-
- if ( ATSPI_IS_COMPONENT(accessibleObject) )
- {
- AtspiComponent * component = ATSPI_COMPONENT(accessibleObject);
- AtspiPoint * size = atspi_component_get_size (component, &error);
- if ( error != NULL )
- {
- g_error_free(error);
- }
- if ( size != NULL )
- {
- *width = size->x;
- *height = size->y;
- g_free ( size );
- }
- }
-}
-
-static void find_objects(AtspiAccessible* parent, gint x, gint y, gint radius, double* distance, AtspiAccessible **find_app)
-{
- AtspiAccessible* app = NULL;
- GError* err = NULL;
- int jdx, kdx;
-
- int count_child = atspi_accessible_get_child_count(parent, &err);
-
- for(jdx = 0; jdx < count_child; jdx++)
- {
- app = atspi_accessible_get_child_at_index(parent, jdx, &err);
-
- AtspiStateSet* state_set = atspi_accessible_get_state_set (app);
- AtspiStateType state = ATSPI_STATE_VISIBLE;
-
- int height = 0, width = 0, xpos1 = 0, ypos1 = 0, xpos2 = 0, ypos2 = 0;
-
- object_get_wh(app, &width, &height);
- object_get_x_y(app, &xpos1, &ypos1);
-
- gboolean is_visile = atspi_state_set_contains(state_set, state);
-
- if(is_visile == TRUE && width > 0 && height > 0)
- {
- xpos2 = xpos1 + width;
- ypos2 = ypos1 + height;
-
- double set_distance[DISTANCE_NB] = {0};
- double min_distance = DBL_MAX;
-
- set_distance[0] = pow((x - xpos1), 2) + pow((y - ypos1), 2);
- set_distance[1] = pow((x - xpos2), 2) + pow((y - ypos1), 2);
- set_distance[2] = pow((x - xpos1), 2) + pow((y - ypos2), 2);
- set_distance[3] = pow((x - xpos2), 2) + pow((y - ypos2), 2);
- set_distance[4] = DBL_MAX;
- set_distance[5] = DBL_MAX;
- set_distance[6] = DBL_MAX;
- set_distance[7] = DBL_MAX;
-
- if(x >= fmin(xpos1, xpos2) && x <= fmax(xpos1, xpos2))
- {
- set_distance[4] = pow((y - ypos1), 2);
- set_distance[5] = pow((y - ypos2), 2);
- }
-
- if(y >= fmin(ypos1, ypos2) && y <= fmax(ypos1, ypos2))
- {
- set_distance[6] = pow((x - xpos1), 2);
- set_distance[7] = pow((x - xpos2), 2);
- }
-
- for(kdx = 0; kdx < DISTANCE_NB; kdx++)
- {
- if(set_distance[kdx] < min_distance)
- min_distance = set_distance[kdx];
- }
-
- if(min_distance <= *distance && (radius < 0 || (radius >= 0 && min_distance <= radius)))
- {
- *distance = min_distance;
- *find_app = app;
- }
- find_objects(app, x, y, radius, distance, find_app);
- }
- }
-}
-
-
-static AtspiAccessible *get_nearest_widget(AtspiAccessible* app_obj, gint x_cord, gint y_cord, gint radius)
-{
- int xn = 0, yn = 0;
- GError *err = NULL;
- AtspiAccessible* f_app_obj = app_obj;
- double distance = DBL_MAX;
- int jdx = 0;
-
- int count_child = atspi_accessible_get_child_count(app_obj, &err);
-
- find_objects(app_obj, x_cord, y_cord, radius, &distance, &f_app_obj);
-
- return f_app_obj;
-}
-#endif
-
static void _focus_widget(Gesture_Info *info)
{
DEBUG("START");
}
obj = flat_navi_context_next(context);
- // try next line
- if (!obj)
- obj = flat_navi_context_line_next(context);
- // try 'cycle' objects in context
- if (!obj)
- {
- flat_navi_context_line_first(context);
- obj = flat_navi_context_first(context);
- smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
- }
if (obj)
_current_highlight_object_set(obj);
else
do
{
obj = flat_navi_context_next(context);
- // try next line
- if (!obj)
- obj = flat_navi_context_line_next(context);
// try 'cycle' objects in context
if (obj)
{
do
{
obj = flat_navi_context_prev(context);
- // try next line
- if (!obj)
- obj = flat_navi_context_line_prev(context);
// try 'cycle' objects in context
if (obj)
{
}
obj = flat_navi_context_prev(context);
- // try previous line
- if (!obj)
- {
- obj = flat_navi_context_line_prev(context);
- if (obj)
- obj = flat_navi_context_last(context);
- }
- // try 'cycle' objects in context
- if (!obj)
- {
- flat_navi_context_line_last(context);
- obj = flat_navi_context_last(context);
- smart_notification(FOCUS_CHAIN_END_NOTIFICATION_EVENT, 0, 0);
- }
if (obj)
_current_highlight_object_set(obj);
else
GERROR_CHECK(err)
}
*/
-#if 0
-// part of structural navigation
-static void _goto_children_widget(void)
-{
- AtspiAccessible *obj;
- if (!current_obj)
- {
- DEBUG("No current object is set. Aborting diving into children structure");
- return;
- }
- obj = structural_navi_level_down(current_obj);
- if (obj)
- _current_highlight_object_set(obj);
- else
- DEBUG("Unable to find hihglightable children widget");
-}
-
-static void _escape_children_widget(void)
-{
- AtspiAccessible *obj;
- if (!current_obj)
- {
- DEBUG("No current object is set. Aborting escaping from children structure");
- return;
- }
- obj = structural_navi_level_up(current_obj);
- if (obj)
- _current_highlight_object_set(obj);
- else
- DEBUG("Unable to find hihglightable parent widget");
-}
-#endif
static void _widget_scroll(Gesture_Info *gi)
{
if(!obj)
{
- obj = flat_navi_context_line_next(context);
- DEBUG(">>> NEW LINE <<<");
- }
-
- if(!obj)
- {
s_auto_review.auto_review_on = false;
return;
}
{
DEBUG("START");
char *text_to_speak = NULL;
- AtspiAccessible *first = flat_navi_context_first_get(context);
+ AtspiAccessible *first = flat_navi_context_first(context);
AtspiAccessible *obj = flat_navi_context_current_get(context);
if(first != obj)
{
- obj = flat_navi_context_line_first(context);
- _current_highlight_object_set(obj);
+ _current_highlight_object_set(first);
}
else
{
return;
}
- int visi = 0;
AtspiAccessible *obj = NULL;
AtspiAccessible *current = NULL;
AtspiAccessible *parent = NULL;
return;
}
- visi = flat_navi_context_current_children_count_visible_get(context);
- DEBUG("There is %d elements visible", visi);
-
int index = atspi_accessible_get_index_in_parent(current, NULL);
int children_count = atspi_accessible_get_child_count(parent, NULL);
- if (visi <=0 || children_count <=0)
+ if (children_count <=0)
{
ERROR("NO visible element on list");
return;
DEBUG("start from element with index:%d/%d", index, children_count);
- int target = index - visi;
-
- if (target <=0)
+ if (index <=0)
{
DEBUG("first element");
obj = atspi_accessible_get_child_at_index (parent, 0, NULL);
else
{
- DEBUG("go back to %d element", target);
- obj = atspi_accessible_get_child_at_index (parent, target, NULL);
+ DEBUG("go back to %d element", index);
+ obj = atspi_accessible_get_child_at_index (parent, index, NULL);
}
return;
}
- int visi = 0;
AtspiAccessible *obj = NULL;
AtspiAccessible *current = NULL;
AtspiAccessible *parent = NULL;
return;
}
- visi = flat_navi_context_current_children_count_visible_get(context);
- DEBUG("There is %d elements visible", visi);
-
int index = atspi_accessible_get_index_in_parent(current, NULL);
int children_count = atspi_accessible_get_child_count(parent, NULL);
- if (visi <=0 || children_count <=0)
+ if (children_count <=0)
{
ERROR("NO visible element on list");
return;
DEBUG("start from element with index:%d/%d", index, children_count);
- int target = index + visi;
-
- if (target >= children_count)
+ if (index >= children_count)
{
DEBUG("last element");
obj = atspi_accessible_get_child_at_index (parent, children_count-1, NULL);
else
{
- DEBUG("go back to %d element", target);
- obj = atspi_accessible_get_child_at_index (parent, target, NULL);
+ DEBUG("go back to %d element", index);
+ obj = atspi_accessible_get_child_at_index (parent, index, NULL);
}
static void
_direct_scroll_to_first(void)
{
- AtspiAccessible *obj = NULL;
DEBUG("ONE_FINGER_FLICK_UP_RETURN");
- flat_navi_context_line_first(context);
- obj = flat_navi_context_first(context);
- if (flat_navi_context_current_set(context, obj))
+ if (!context)
+ {
+ ERROR("No navigation context created");
+ return;
+ }
+ AtspiAccessible *obj = flat_navi_context_first(context);
+ if (obj)
_current_highlight_object_set(obj);
+ else
+ DEBUG("First widget not found. Abort");
+ DEBUG("END");
}
static void
_direct_scroll_to_last(void)
{
DEBUG("ONE_FINGER_FLICK_DOWN_RETURN");
- AtspiAccessible *obj = NULL;
- flat_navi_context_line_last(context);
- obj = flat_navi_context_last(context);
- if (flat_navi_context_current_set(context, obj))
+ if (!context)
+ {
+ ERROR("No navigation context created");
+ return;
+ }
+ AtspiAccessible *obj = flat_navi_context_last(context);
+ if (obj)
_current_highlight_object_set(obj);
+ else
+ DEBUG("Last widget not found. Abort");
+ DEBUG("END");
}
static Eina_Bool
}
static void
-_on_cache_builded(void *data)
-{
- DEBUG("START");
- _window_cache_builded = EINA_TRUE;
- AtspiAccessible *pivot = NULL;
- if (context && !_window_top_changed)
- {
- DEBUG("Context exists and window as not changed");
- pivot = flat_navi_context_current_get(context);
- _current_highlight_object_set(pivot);
- DEBUG("END");
- return;
- }
-
- _window_top_changed = false;
- context = flat_navi_context_create(top_window);
-
- if (context)
- {
- DEBUG("New context and current obj highlighted");
- _current_highlight_object_set(flat_navi_context_current_get(context));
- DEBUG("END");
- return;
- }
- ERROR("No context");
-}
-
-static void
-_view_content_changed(void *user_data)
+_view_content_changed(AtspiAccessible *root, void *user_data)
{
DEBUG("START");
- _window_top_changed = EINA_TRUE;
- _window_cache_builded = EINA_FALSE;
- if (top_window)
- object_cache_build_async(top_window, 5, _on_cache_builded, NULL);
+ if (flat_navi_is_valid(context, root))
+ return;
+ flat_navi_context_free(context);
+ context = flat_navi_context_create(root);
+ _current_highlight_object_set(flat_navi_context_current_get(context));
DEBUG("END");
}
{
DEBUG("Window name: %s", atspi_accessible_get_name(window, NULL));
app_tracker_callback_register(window, _view_content_changed, NULL);
- _window_cache_builded = EINA_FALSE;
- object_cache_build_async(window, 5, _on_cache_builded, NULL);
+ _view_content_changed(window, NULL);
}
else
{
- ERROR("No top window found!");
+ flat_navi_context_free(context);
+ ERROR("No top window found!");
}
top_window = window;
- _window_top_changed = true;
DEBUG("END");
}
context = NULL;
}
dbus_gesture_adapter_shutdown();
- object_cache_shutdown();
app_tracker_shutdown();
window_tracker_shutdown();
smart_notification_shutdown();
+++ /dev/null
-#include <Eina.h>
-#include <Ecore.h>
-
-#include "object_cache.h"
-#include "logger.h"
-
-static Eina_Hash *cache;
-static Ecore_Idler *idler;
-static Eina_List *toprocess;
-static void *user_data;
-static ObjectCacheReadyCb callback;
-static int bulk;
-
-static void
-_cache_item_free_cb(void *data)
-{
- ObjectCache *co = data;
- g_free(co->bounds);
- free(co);
-}
-
-static void
-_list_obj_unref_and_free(Eina_List *toprocess)
-{
- AtspiAccessible *obj;
- EINA_LIST_FREE(toprocess, obj)
- {
- if (obj) g_object_unref(obj);
- }
-}
-
-static void
-_object_cache_free_internal(void)
-{
- if (idler)
- {
- ecore_idler_del(idler);
- idler = NULL;
- }
- if (toprocess)
- {
- _list_obj_unref_and_free(toprocess);
- toprocess = NULL;
- }
- if (cache)
- {
- eina_hash_free(cache);
- cache = NULL;
- }
-}
-
-/**
- * Returnes a list of all accessible object implementing AtkCompoment interface
- * Eina_List should be free with eina_list_free function.
- * Every AtspiAccessible in list should be unrefed with g_object_unref.
- */
-static Eina_List*
-_cache_candidates_list_prepare(AtspiAccessible *root)
-{
- DEBUG("START");
-
- if (!root) return NULL;
- AtspiAccessible *r = atspi_accessible_get_parent(root, NULL);
- if (r)
- DEBUG("From application:%s [%s]", atspi_accessible_get_name(r, NULL), atspi_accessible_get_role_name(r, NULL));
- DEBUG("Preparing candidates from root window: %s [%s]", atspi_accessible_get_name(root, NULL), atspi_accessible_get_role_name(root, NULL));
-
- Eina_List *toprocess = NULL, *ret = NULL;
- int n, i;
-
- // Keep ref counter +1 on every object in returned list
- g_object_ref(root);
- toprocess = eina_list_append(toprocess, root);
-
- while (toprocess)
- {
- AtspiAccessible *obj = eina_list_data_get(toprocess);
- toprocess = eina_list_remove_list(toprocess, toprocess);
- if (!obj)
- {
- DEBUG("NO OBJ");
- continue;
- }
- n = atspi_accessible_get_child_count(obj, NULL);
- for (i = 0; i < n; i++)
- {
- AtspiAccessible *cand = atspi_accessible_get_child_at_index(obj, i, NULL);
- if(cand)
- toprocess = eina_list_append(toprocess, cand);
- }
- ret = eina_list_append(ret, obj);
- }
- DEBUG("END");
-
- return ret;
-}
-
-static ObjectCache*
-_cache_item_construct(AtspiAccessible *obj)
-{
- ObjectCache *ret;
- AtspiComponent *comp;
-
- if (!obj)
- {
- ERROR("object is NULL");
- return NULL;
- }
-
- ret = calloc(1, sizeof(ObjectCache));
- if (!ret)
- {
- ERROR("out-of memory");
- return NULL;
- }
-
- comp = atspi_accessible_get_component_iface(obj);
- if (!comp)
- {
- ERROR("Cached Object do not implement Component interface");
- }
- else
- {
- ret->bounds = atspi_component_get_extents(comp, ATSPI_COORD_TYPE_SCREEN, NULL);
- g_object_unref(comp);
- }
-
- return ret;
-}
-
-static Eina_List*
-_cache_item_n_cache(Eina_List *objs, int count)
-{
- int i = 0;
- Eina_List *ret = objs;
- ObjectCache *oc;
- AtspiAccessible *obj;
-
- for (i = 0; (i < count) && ret; i++)
- {
- obj = eina_list_data_get(ret);
- ret = eina_list_remove_list(ret, ret);
-
- oc = _cache_item_construct(obj);
- if (!oc) break;
-
- eina_hash_add(cache, &obj, oc);
- g_object_unref(obj);
- }
-
- return ret;
-}
-
-static Eina_Hash*
-_object_cache_new(void)
-{
- return eina_hash_pointer_new(_cache_item_free_cb);
-}
-
-static Eina_Bool
-_do_cache(void *data)
-{
- toprocess = _cache_item_n_cache(toprocess, bulk);
- idler = NULL;
-
- if (toprocess)
- idler = ecore_idler_add(_do_cache, NULL);
- else if (callback) callback(user_data);
-
- return EINA_FALSE;
-}
-
-void
-object_cache_build_async(AtspiAccessible *root, int bulk_size, ObjectCacheReadyCb cb, void *ud)
-{
- DEBUG("START");
-
- _object_cache_free_internal();
-
- callback = cb;
- user_data = ud;
- bulk = bulk_size;
-
- cache = _object_cache_new();
- if (!cache)
- {
- ERROR("ObjectCache: hash table creation failed");
- return;
- }
-
- DEBUG("will be preparing async candidates from:[%s] with role:[%s]\n",
- atspi_accessible_get_name(root, NULL),
- atspi_accessible_get_role_name(root, NULL));
- toprocess = _cache_candidates_list_prepare(root);
- idler = ecore_idler_add(_do_cache, NULL);
- DEBUG("END");
- return;
-}
-
-void
-object_cache_shutdown(void)
-{
- _object_cache_free_internal();
-}
-
-const ObjectCache*
-object_cache_get(AtspiAccessible *obj)
-{
- ObjectCache *ret = NULL;
- if (idler)
- {
- ERROR("Invalid usage. Async cache build is ongoing...");
- return NULL;
- }
-
- if (!cache)
- {
- cache = _object_cache_new();
- if (!cache)
- {
- ERROR("ObjectCache: hash table creation failed");
- return NULL;
- }
- }
-
- ret = eina_hash_find(cache, &obj);
- if (!ret)
- {
- DEBUG("EMPTY");
- // fallback to blocking d-bus call
- ret = _cache_item_construct(obj);
- eina_hash_add(cache, &obj, ret);
- }
- return ret;
-}
+++ /dev/null
-#include "logger.h"
-#include "object_cache.h"
-#include "position_sort.h"
-
-
-static int
-_sort_vertically(const void *a, const void *b)
-{
- AtspiAccessible *objA, *objB;
- const ObjectCache *cA, *cB;
-
- objA = (AtspiAccessible*)a;
- objB = (AtspiAccessible*)b;
-
- cA = object_cache_get(objA);
- cB = object_cache_get(objB);
-
- if (!cA || !cB)
- {
- ERROR("Cache is not ready yet");
- return 0;
- }
-
- if (cA->bounds->y == cB->bounds->y)
- return 0;
- else if (cA->bounds->y > cB->bounds->y)
- return 1;
- else
- return -1;
-}
-
-static int
-_sort_horizontally(const void *a, const void *b)
-{
- AtspiAccessible *objA, *objB;
- const ObjectCache *cA, *cB;
-
- objA = (AtspiAccessible*)a;
- objB = (AtspiAccessible*)b;
-
- cA = object_cache_get(objA);
- cB = object_cache_get(objB);
-
- if (!cA || !cB)
- {
- ERROR("Cache is not ready yet");
- return 0;
- }
-
- if (cA->bounds->x == cB->bounds->x)
- {
- if (cA->bounds->y > cB->bounds->y)
- return 1;
- if (cA->bounds->y < cB->bounds->y)
- return -1;
- return 0;
- }
- else if (cA->bounds->x > cB->bounds->x)
- return 1;
- else
- return -1;
-}
-
-static int
-_sort_index(const void *a, const void *b)
-{
- int ia, ib;
-
- AtspiComponent *comp1 = atspi_accessible_get_component_iface((AtspiAccessible*)a);
- AtspiComponent *comp2 = atspi_accessible_get_component_iface((AtspiAccessible*)b);
-
- ia = atspi_component_get_highlight_index(comp1, NULL);
- ib = atspi_component_get_highlight_index(comp2, NULL);
- g_object_unref(comp1);
- g_object_unref(comp2);
-
- return ia == ib ? 0 : ia > ib ? 1 : -1;
-}
-
-static void
-_get_priorities(const Eina_List *objs, Eina_List **priority, Eina_List **candidates, Eina_List **priority_after)
-{
- const Eina_List *l;
- AtspiAccessible *obj;
- AtspiComponent *comp;
-
- EINA_LIST_FOREACH(objs, l, obj)
- {
- if ((comp = atspi_accessible_get_component_iface(obj)) != NULL)
- {
- int index = atspi_component_get_highlight_index(comp, NULL);
- g_clear_object(&comp);
- if (index == 0)
- *candidates = eina_list_append(*candidates, obj);
- else if (index > 0)
- {
- if (index < INT_MAX/2)
- *priority = eina_list_append(*priority, obj);
- else
- *priority_after = eina_list_append(*priority_after, obj);
- }
- }
- else
- DEBUG("No component interface: skipping %s %s",
- atspi_accessible_get_name(obj, NULL),
- atspi_accessible_get_role_name(obj, NULL));
- }
-
- *priority = eina_list_sort(*priority, 0, _sort_index);
- *priority_after = eina_list_sort(*priority_after, 0, _sort_index);
-}
-
-static Eina_List*
-_get_zones(const Eina_List *objs)
-{
- Eina_List *candidates = NULL;
- const Eina_List *l;
- AtspiAccessible *obj;
- const ObjectCache *oc;
-
- EINA_LIST_FOREACH(objs, l, obj)
- {
-
- oc = object_cache_get(obj);
-
- if (!oc)
- {
- ERROR("Cache is not ready yet");
- continue;
- }
- // some objects may implement AtspiCompoment interface, however
- // they do not have valid sizes.
- if (!oc->bounds || (oc->bounds->width < 0) || oc->bounds->height < 0)
- {
- DEBUG("Invalid bounds. skipping from zone list: %s %s",
- atspi_accessible_get_name(obj, NULL),
- atspi_accessible_get_role_name(obj, NULL));
- continue;
- }
- candidates = eina_list_append(candidates, obj);
-
- }
-
- // Sort object by y - coordinate
- return eina_list_sort(candidates, 0, _sort_vertically);
-}
-
-static Eina_List*
-_get_lines(const Eina_List *objs)
-{
- Eina_List *line = NULL, *lines = NULL;
- const Eina_List *l;
- AtspiAccessible *obj;
- const ObjectCache *line_beg;
-
- EINA_LIST_FOREACH(objs, l, obj)
- {
- if (!line)
- {
- // set first object in line
- line = eina_list_append(line, obj);
- line_beg = object_cache_get(obj);
- continue;
- }
-
- const ObjectCache *oc = object_cache_get(obj);
- // Object are considered as present in same line, if
- // its y coordinate begins maximum 25% below
- // y coordinate% of first object in line.
- if ((line_beg->bounds->y + (int)(0.25 * (double)line_beg->bounds->height)) >
- oc->bounds->y)
- {
- line = eina_list_append(line, obj);
- continue;
- }
- else
- {
- //finish line & set new line leader
- lines = eina_list_append(lines, line);
- line = NULL;
- line = eina_list_append(line, obj);
- line_beg = object_cache_get(obj);
- }
- }
-
- // finish last line
- if (line) lines = eina_list_append(lines, line);
-
- return lines;
-}
-
-Eina_List *position_sort(const Eina_List *objs)
-{
- Eina_List *l = NULL, *line = NULL, *zones = NULL, *priority = NULL, *priority_after = NULL, *lines = NULL;
- Eina_List *candidates = NULL;
- int i = 0;
-
- _get_priorities(objs, &priority, &candidates, &priority_after);
- DEBUG("With positive index it is: %d", eina_list_count(priority));
- // Get list of objects occupying place on the screen
- DEBUG("PositionSort: Candidates; %d", eina_list_count(candidates));
- zones = _get_zones(candidates);
-
- // Cluster all zones into lines - verticaly
- DEBUG("PositionSort: Zones; %d", eina_list_count(zones));
- lines = _get_lines(zones);
-
- // sort all zones in line - horizontaly
- DEBUG("PositionSort: Lines; %d", eina_list_count(lines));
- EINA_LIST_FOREACH(lines, l, line)
- {
- DEBUG("PositionSort: Line %d: %d items", i++, eina_list_count(line));
- line = eina_list_sort(line, 0, _sort_horizontally);
- eina_list_data_set(l, line);
- }
-
- if (eina_list_count(priority) > 0)
- lines = eina_list_prepend(lines, priority);
-
- if (eina_list_count(priority_after) > 0)
- lines = eina_list_append(lines, priority_after);
-
- if (zones) eina_list_free(zones);
-
- return lines;
-}
if ( !text_to_speak ) return;
if ( !text_to_speak[0] ) return;
int ret = 0;
- if(ret = tts_add_text( sd->tts, text_to_speak, NULL, TTS_VOICE_TYPE_AUTO, TTS_SPEED_AUTO, &speak_id))
+ if((ret = tts_add_text( sd->tts, text_to_speak, NULL, TTS_VOICE_TYPE_AUTO, TTS_SPEED_AUTO, &speak_id)))
{
switch(ret) {
case TTS_ERROR_INVALID_PARAMETER:
+++ /dev/null
-#include "structural_navi.h"
-#include "position_sort.h"
-#include "logger.h"
-
-static Eina_List*
-_atspi_children_list_get(AtspiAccessible *parent)
-{
- Eina_List *ret = NULL;
- int count = atspi_accessible_get_child_count(parent, NULL);
- int i;
-
- for (i = 0; i < count; i++)
- {
- AtspiAccessible *child = atspi_accessible_get_child_at_index(parent, i, NULL);
- if (child) ret = eina_list_append(ret, child);
- }
-
- return ret;
-}
-
-static void
-_atspi_children_list_free(Eina_List *children)
-{
- AtspiAccessible *obj;
-
- EINA_LIST_FREE(children, obj)
- {
- g_object_unref(obj);
- }
-}
-
-static Eina_List*
-_flat_review_get(Eina_List *tosort)
-{
- Eina_List *ret = NULL, *lines, *l, *line;
-
- lines = position_sort(tosort);
-
- EINA_LIST_FOREACH(lines, l, line)
- {
- ret = eina_list_merge(ret, line);
- }
-
- eina_list_free(lines);
-
- return ret;
-}
-
-AtspiAccessible *structural_navi_same_level_next(AtspiAccessible *current)
-{
- AtspiAccessible *parent;
- AtspiRole role;
-
- parent = atspi_accessible_get_parent(current, NULL);
- if (!parent) return NULL;
-
- role = atspi_accessible_get_role(parent, NULL);
- if (role != ATSPI_ROLE_DESKTOP_FRAME)
- {
- Eina_List *children = _atspi_children_list_get(parent);
- Eina_List *me = eina_list_data_find_list(children, current);
- Eina_List *sorted = _flat_review_get(children);
- me = eina_list_data_find_list(sorted, current);
- AtspiAccessible *ret = eina_list_data_get(eina_list_next(me));
-
- eina_list_free(sorted);
- _atspi_children_list_free(children);
-
- return ret;
- }
- return NULL;
-}
-
-AtspiAccessible *structural_navi_same_level_prev(AtspiAccessible *current)
-{
- AtspiAccessible *parent;
- AtspiRole role;
-
- parent = atspi_accessible_get_parent(current, NULL);
- if (!parent) return NULL;
-
- role = atspi_accessible_get_role(parent, NULL);
- if (role != ATSPI_ROLE_DESKTOP_FRAME)
- {
- Eina_List *children = _atspi_children_list_get(parent);
- Eina_List *sorted = _flat_review_get(children);
- Eina_List *me = eina_list_data_find_list(sorted, current);
- AtspiAccessible *ret = eina_list_data_get(eina_list_prev(me));
-
- eina_list_free(sorted);
- _atspi_children_list_free(children);
-
- return ret;
- }
- return NULL;
-}
-
-AtspiAccessible *structural_navi_level_up(AtspiAccessible *current)
-{
- AtspiAccessible *parent;
- AtspiRole role;
-
- parent = atspi_accessible_get_parent(current, NULL);
- if (!parent) return NULL;
-
- role = atspi_accessible_get_role(parent, NULL);
- if (role != ATSPI_ROLE_DESKTOP_FRAME)
- {
- return parent;
- }
- return NULL;
-}
-
-AtspiAccessible *structural_navi_level_down(AtspiAccessible *current)
-{
- AtspiAccessible *ret;
-
- Eina_List *children = _atspi_children_list_get(current);
- Eina_List *sorted = _flat_review_get(children);
-
- ret = eina_list_data_get(sorted);
-
- eina_list_free(sorted);
- _atspi_children_list_free(children);
-
- return ret;
-}
-
-static AtspiAccessible*
-_navi_app_chain_next(AtspiAccessible *current, AtspiRelationType search_type)
-{
- GArray *relations;
- AtspiAccessible *ret = NULL;
- AtspiRelation *relation;
- AtspiRelationType type;
- int i;
-
- relations = atspi_accessible_get_relation_set(current, NULL);
- if (!relations) return ret;
-
- for (i = 0; i < relations->len; i++)
- {
- relation = g_array_index (relations, AtspiRelation*, i);
- type = atspi_relation_get_relation_type(relation);
-
- if (type == search_type)
- {
- ret = atspi_relation_get_target(relation, 0);
- break;
- }
- }
-
- g_array_free(relations, TRUE);
- return ret;
-}
-
-AtspiAccessible *structural_navi_app_chain_next(AtspiAccessible *current)
-{
- return _navi_app_chain_next(current, ATSPI_RELATION_FLOWS_TO);
-}
-
-AtspiAccessible *structural_navi_app_chain_prev(AtspiAccessible *current)
-{
- return _navi_app_chain_next(current, ATSPI_RELATION_FLOWS_FROM);
-}
if (user_cb) user_cb(user_data, event->source);
last_active_win = event->source;
}
- if (!strcmp(event->type, "window:deactivate") ||
- !strcmp(event->type, "window:destroy"))
- {
- if (last_active_win != event->source)
- return;
- if (user_cb) user_cb(user_data, NULL);
- last_active_win = NULL;
- }
}
static AtspiAccessible*
{
DEBUG("START");
listener = atspi_event_listener_new_simple(_on_atspi_window_cb, NULL);
- atspi_event_listener_register(listener, "window:deactivate", NULL);
atspi_event_listener_register(listener, "window:create", NULL);
- atspi_event_listener_register(listener, "window:destroy", NULL);
atspi_event_listener_register(listener, "window:activate", NULL);
atspi_event_listener_register(listener, "window:restore", NULL);
}
void window_tracker_shutdown(void)
{
DEBUG("START");
- atspi_event_listener_deregister(listener, "window:deactivate", NULL);
atspi_event_listener_deregister(listener, "window:create", NULL);
atspi_event_listener_deregister(listener, "window:activate", NULL);
atspi_event_listener_deregister(listener, "window:restore", NULL);
- atspi_event_listener_deregister(listener, "window:destroy", NULL);
g_object_unref(listener);
listener = NULL;
user_cb = NULL;
${CMAKE_SOURCE_DIR}/src/screen_reader_spi.c
${CMAKE_SOURCE_DIR}/src/screen_reader_tts.c
${CMAKE_SOURCE_DIR}/src/logger.c
- ${CMAKE_SOURCE_DIR}/src/flat_navi.c
- ${CMAKE_SOURCE_DIR}/src/position_sort.c
- ${CMAKE_SOURCE_DIR}/src/object_cache.c)
+ ${CMAKE_SOURCE_DIR}/src/flat_navi.c)
ADD_DEFINITIONS(-DSCREEN_READER_FLAT_NAVI_TEST_DUMMY_IMPLEMENTATION)
ADD_EXECUTABLE(smart_navi_test_suite smart_navi_suite.c ${TESTED_SRCS})
static AtspiValue *value = NULL;
static AtspiText *text = NULL;
static AtspiEditableText *editable_text = NULL;
+static AtspiAction *action = NULL;
//static AtspiComponent *component = NULL;
G_DEFINE_TYPE(AtspiAccessible, atspi_accessible, G_TYPE_OBJECT);
+G_DEFINE_TYPE(AtspiAction, atspi_action, G_TYPE_OBJECT);
G_DEFINE_TYPE(AtspiComponent, atspi_component, G_TYPE_OBJECT);
G_DEFINE_TYPE(AtspiStateSet, atspi_state_set, G_TYPE_OBJECT);
return strdup("Entry");
case ATSPI_ROLE_FILLER:
return strdup("filler");
+ case ATSPI_ROLE_SCROLL_PANE:
+ return strdup("scroll pane");
+ case ATSPI_ROLE_IMAGE:
+ return strdup("image");
+ case ATSPI_ROLE_SPLIT_PANE:
+ return strdup("split pane");
+ case ATSPI_ROLE_UNKNOWN:
+ return strdup("unknown");
+ case ATSPI_ROLE_RULER:
+ return strdup("ruler");
+ case ATSPI_ROLE_FOOTER:
+ return strdup("footer");
+ case ATSPI_ROLE_INFO_BAR:
+ return strdup("infobar");
+ case ATSPI_ROLE_LINK:
+ return strdup("link");
default:
return strdup("\0");
}
return strdup(obj->description);
}
+AtspiAction * atspi_accessible_get_action_iface (AtspiAccessible *obj)
+{
+ if(!obj) return NULL;
+ return action;
+}
+
AtspiText * atspi_accessible_get_text_iface (AtspiAccessible *obj)
{
if(!obj) return NULL;
}
else if(*(component->role) == ATSPI_ROLE_PUSH_BUTTON)
{
- rect.x = 0;
- rect.y = 0;
+ rect.x = 1;
+ rect.y = 1;
rect.width = 50;
rect.height = 50;
}
{
AtspiAccessible *obj = g_object_new(ATSPI_ACCESSIBLE_OBJECT_TYPE, 0);
obj->children = NULL;
+ obj->index_in_parent = 0;
+ obj->child_count = 0;
GArray *states = g_array_new (TRUE, TRUE, sizeof (AtspiStateType));
AtspiStateType s[] =
void atspi_accessible_add_child(AtspiAccessible *obj, AtspiAccessible *child)
{
+ child->index_in_parent = obj->child_count;
+ child->accessible_parent = obj;
obj->children = g_list_append(obj->children, child);
+ obj->child_count++;
}
void atpis_accessible_remove_children(AtspiAccessible *obj)
{
}
+static void atspi_action_class_init(AtspiActionClass *_class)
+{
+}
+
+static void atspi_action_init(AtspiAction* obj)
+{
+}
+
static void atspi_accessible_class_init(AtspiAccessibleClass *_class)
{
}
return 0;
}
-AtspiAction * atspi_accessible_get_action_iface (AtspiAccessible *obj)
-{
- return NULL;
-}
-
gint atspi_action_get_n_actions(AtspiAction *obj, GError **error)
{
return 0;
return strdup("");
}
+gint atspi_accessible_get_index_in_parent (AtspiAccessible *obj, GError **error)
+{
+ return obj->index_in_parent;
+}
+
int atspi_exit(void)
{
return 1;
#define ATSPI_ACCESSIBLE_OBJECT_TYPE (atspi_accessible_get_type ())
#define ATSPI_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_ACCESSIBLE_OBJECT_TYPE, AtspiAccessible))
-#define ATSPI_ACESSIBLE_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_ACCESSIBLE_OBJECT_TYPE))
+#define ATSPI_ACCESSIBLE_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_ACCESSIBLE_OBJECT_TYPE))
#define ATSPI_ACCESSIBLE_CLASS(_class) (G_TYPE_CHECK_CLASS_CAST ((_class), ATSPI_ACCESSIBLE_OBJECT_TYPE, AtspiAccessibleClass))
#define ATSPI_ACCESSIBLE_IS_OBJECT_CLASS(_class) (G_TYPE_CHECK_CLASS_TYPE ((_class), ATSPI_ACCESSIBLE_OBJECT_TYPE))
#define ATSPI_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_ACCESSIBLE_OBJECT_TYPE, AtspiAccessibleClass))
+#define ATSPI_ACTION_OBJECT_TYPE (atspi_action_get_type ())
+#define ATSPI_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_ACTION_OBJECT_TYPE, AtspiAccessible))
+#define ATSPI_ACTION_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_ACTION_OBJECT_TYPE))
+#define ATSPI_ACTION_CLASS(_class) (G_TYPE_CHECK_CLASS_CAST ((_class), ATSPI_ACTION_OBJECT_TYPE, AtspiAccessibleClass))
+#define ATSPI_ACTION_IS_OBJECT_CLASS(_class) (G_TYPE_CHECK_CLASS_TYPE ((_class), ATSPI_ACTION_OBJECT_TYPE))
+#define ATSPI_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_ACTION_OBJECT_TYPE, AtspiAccessibleClass))
+
#define ATSPI_COMPONENT_OBJECT_TYPE (atspi_component_get_type ())
#define ATSPI_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_COMPONENT_OBJECT_TYPE, AtspiAccessible))
#define ATSPI_COMPONENT_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_COMPONENT_OBJECT_TYPE))
typedef struct _AtspiApplication AtspiApplication;
typedef struct _AtspiObject AtspiObject;
typedef struct _AtspiAccessible AtspiAccessible;
+typedef struct _AtspiAction AtspiAction;
typedef struct _AtspiEvent AtspiEvent;
typedef struct _AtspiStateSet AtspiStateSet;
typedef struct _AtspiEventListener AtspiEventListener;
typedef struct _AtspiAction AtspiAction;
typedef struct _AtspiAccessibleClass AtspiAccessibleClass;
+typedef struct _AtspiActionClass AtspiActionClass;
typedef struct _AtspiComponentClass AtspiComponentClass;
typedef struct _AtspiStateSetClass AtspiStateSetClass;
AtspiStateSet *states;
GHashTable *attributes;
guint cached_properties;
+ gint index_in_parent;
+ gint child_count;
};
struct _AtspiAccessibleClass
GObjectClass parent_class;
};
-struct _AtspiAction
+struct _AtspiActionClass
{
- GTypeInterface parent;
+ GObjectClass parent_class;
};
struct _AtspiComponentClass
GDestroyNotify cb_destroyed;
};
+struct _AtspiAction
+{
+ GTypeInterface parent;
+};
struct _AtspiText
{
GTypeInterface parent;
gchar * atspi_accessible_get_toolkit_name (AtspiAccessible *obj, GError **error);
gchar * atspi_accessible_get_description (AtspiAccessible *obj, GError **error);
AtspiText * atspi_accessible_get_text_iface (AtspiAccessible *obj);
+AtspiAction * atspi_accessible_get_action_iface (AtspiAccessible *obj);
gint atspi_text_get_character_count (AtspiText *obj, GError **error);
gint atspi_text_get_caret_offset (AtspiText *obj, GError **error);
gchar * atspi_text_get_text (AtspiText *obj, gint start_offset, gint end_offset, GError **error);
AtspiAccessible * atspi_accessible_get_parent (AtspiAccessible *obj, GError **error);
gboolean atspi_component_contains (AtspiComponent *obj, gint x, gint y, AtspiCoordType ctype, GError **error);
int atspi_component_get_highlight_index(AtspiComponent *obj, GError **error);
+gint atspi_accessible_get_index_in_parent (AtspiAccessible *obj, GError **error);
AtspiAction * atspi_accessible_get_action_iface (AtspiAccessible *obj);
gint atspi_action_get_n_actions (AtspiAction *obj, GError **error);
gchar * atspi_action_get_action_name (AtspiAction *obj, gint i, GError **error);
#include <Eina.h>
static AtspiAccessible *root;
+static AtspiAccessible *app;
+static AtspiAccessible *win;
+static AtspiAccessible *ly;
static AtspiAccessible *child1;
static AtspiAccessible *child2;
static AtspiAccessible *child3;
static AtspiAccessible *child4;
+static AtspiAccessible *child5;
+static AtspiAccessible *child6;
+static AtspiAccessible *child7;
+static AtspiAccessible *child8;
+static AtspiAccessible *child9;
+static AtspiAccessible *child10;
+static AtspiAccessible *child11;
+static AtspiAccessible *child12;
+static AtspiAccessible *child13;
+static AtspiAccessible *child14;
+static AtspiAccessible *child15;
+static AtspiAccessible *child16;
+static AtspiAccessible *child17;
+static AtspiAccessible *child18;
+static AtspiAccessible *child19;
+static AtspiAccessible *child20;
+static AtspiAccessible *child21;
+static AtspiAccessible *child22;
+static AtspiAccessible *child23;
static FlatNaviContext *ctx;
void setup(void)
ctx = flat_navi_context_create(root);
}
+void setup_flat_navi2()
+{
+ setup();
+ app = atspi_create_accessible();
+ app->role = ATSPI_ROLE_APPLICATION;
+
+ root = app;
+ win = atspi_create_accessible();
+ win->role = ATSPI_ROLE_WINDOW;
+
+ child1 = atspi_create_accessible();
+ child2 = atspi_create_accessible();
+ child3 = atspi_create_accessible();
+ child4 = atspi_create_accessible();
+ child5 = atspi_create_accessible();
+ child6 = atspi_create_accessible();
+ child7 = atspi_create_accessible();
+ child8 = atspi_create_accessible();
+
+ child1->role = ATSPI_ROLE_FILLER;
+ child2->role = ATSPI_ROLE_FILLER;
+ child3->role = ATSPI_ROLE_FILLER;
+ child4->role = ATSPI_ROLE_FILLER;
+ child7->role = ATSPI_ROLE_FILLER;
+ child8->role = ATSPI_ROLE_FILLER;
+
+ child5->role = ATSPI_ROLE_PUSH_BUTTON;
+ child5->name = "btn1";
+ child6->role = ATSPI_ROLE_PUSH_BUTTON;
+ child6->name = "btn2";
+
+ atspi_accessible_add_child(app, win);
+ atspi_accessible_add_child(win, child1);
+ atspi_accessible_add_child(win, child7);
+ atspi_accessible_add_child(win, child2);
+
+ atspi_accessible_add_child(child1, child3);
+ atspi_accessible_add_child(child2, child4);
+
+ atspi_accessible_add_child(child7, child8);
+
+ atspi_accessible_add_child(child3, child5);
+ atspi_accessible_add_child(child4, child6);
+ eina_init();
+ atspi_alloc_memory();
+ ctx = flat_navi_context_create(win);
+}
+
+void setup_flat_navi3()
+{
+ setup();
+ app = atspi_create_accessible();
+ app->role = ATSPI_ROLE_APPLICATION;
+
+ root = app;
+ win = atspi_create_accessible();
+ win->role = ATSPI_ROLE_WINDOW;
+
+ ly = atspi_create_accessible();
+ ly->role = ATSPI_ROLE_FILLER;
+
+ child1 = atspi_create_accessible();
+ child2 = atspi_create_accessible();
+ child3 = atspi_create_accessible();
+ child4 = atspi_create_accessible();
+ child5 = atspi_create_accessible();
+ child6 = atspi_create_accessible();
+ child7 = atspi_create_accessible();
+ child8 = atspi_create_accessible();
+ child9 = atspi_create_accessible();
+ child10 = atspi_create_accessible();
+ child11 = atspi_create_accessible();
+ child12 = atspi_create_accessible();
+ child13 = atspi_create_accessible();
+ child14 = atspi_create_accessible();
+ child15 = atspi_create_accessible();
+ child16 = atspi_create_accessible();
+ child17 = atspi_create_accessible();
+ child18 = atspi_create_accessible();
+ child19 = atspi_create_accessible();
+ child20 = atspi_create_accessible();
+ child21 = atspi_create_accessible();
+ child22 = atspi_create_accessible();
+ child23 = atspi_create_accessible();
+
+ child1->role = ATSPI_ROLE_FILLER;
+ child3->role = ATSPI_ROLE_FILLER;
+ child4->role = ATSPI_ROLE_FILLER;
+ child5->role = ATSPI_ROLE_FILLER;
+ child6->role = ATSPI_ROLE_FILLER;
+ child7->role = ATSPI_ROLE_FILLER;
+ child8->role = ATSPI_ROLE_FILLER;
+ child9->role = ATSPI_ROLE_FILLER;
+ child10->role = ATSPI_ROLE_FILLER;
+ child11->role = ATSPI_ROLE_FILLER;
+ child12->role = ATSPI_ROLE_FILLER;
+ child14->role = ATSPI_ROLE_FILLER;
+ child15->role = ATSPI_ROLE_FILLER;
+ child17->role = ATSPI_ROLE_FILLER;
+ child18->role = ATSPI_ROLE_FILLER;
+ child20->role = ATSPI_ROLE_FILLER;
+ child21->role = ATSPI_ROLE_FILLER;
+ child23->role = ATSPI_ROLE_FILLER;
+
+ child2->role = ATSPI_ROLE_PUSH_BUTTON;
+ child2->name = "btn1";
+ child13->role = ATSPI_ROLE_PUSH_BUTTON;
+ child13->name = "btn2";
+ child16->role = ATSPI_ROLE_PUSH_BUTTON;
+ child16->name = "btn3";
+ child19->role = ATSPI_ROLE_PUSH_BUTTON;
+ child19->name = "btn4";
+ child22->role = ATSPI_ROLE_PUSH_BUTTON;
+ child22->name = "btn5";
+
+
+ atspi_accessible_add_child(app, win);
+ atspi_accessible_add_child(win, ly);
+
+ atspi_accessible_add_child(ly, child1);
+ atspi_accessible_add_child(ly, child3);
+ atspi_accessible_add_child(ly, child4);
+
+ atspi_accessible_add_child(child1, child2);
+
+ atspi_accessible_add_child(child4, child5);
+
+ atspi_accessible_add_child(child5, child6);
+
+ atspi_accessible_add_child(child6, child7);
+
+ atspi_accessible_add_child(child7, child8);
+ atspi_accessible_add_child(child7, child9);
+ atspi_accessible_add_child(child7, child10);
+ atspi_accessible_add_child(child7, child11);
+
+ atspi_accessible_add_child(child8, child12);
+ atspi_accessible_add_child(child8, child13);
+ atspi_accessible_add_child(child8, child14);
+
+ atspi_accessible_add_child(child9, child15);
+ atspi_accessible_add_child(child9, child16);
+ atspi_accessible_add_child(child9, child17);
+
+ atspi_accessible_add_child(child10, child18);
+ atspi_accessible_add_child(child10, child19);
+ atspi_accessible_add_child(child10, child20);
+
+ atspi_accessible_add_child(child11, child21);
+ atspi_accessible_add_child(child11, child22);
+ atspi_accessible_add_child(child11, child23);
+
+ eina_init();
+ atspi_alloc_memory();
+ ctx = flat_navi_context_create(win);
+}
+
+
void teardown_flat_navi()
{
flat_navi_context_free(ctx);
atspi_free_memory();
eina_shutdown();
atspi_delete_accessible(root);
+ atspi_delete_accessible(app);
teardown();
}
START_TEST(spi_flat_navi_context_create_null_parameter)
{
FlatNaviContext *test_ctx = flat_navi_context_create(NULL);
- fail_if(!test_ctx);
- free(test_ctx);
+ fail_if(test_ctx);
}
END_TEST
START_TEST(spi_flat_navi_context_create_valid_parameter)
{
- FlatNaviContext *test_ctx = flat_navi_context_create(root);
+ FlatNaviContext *test_ctx = flat_navi_context_create(win);
fail_if(!test_ctx);
flat_navi_context_free(test_ctx);
}
END_TEST
+
START_TEST(spi_flat_navi_context_get_current_null_parameter)
{
AtspiAccessible *current = flat_navi_context_current_get(NULL);
START_TEST(spi_flat_navi_context_get_current_valid_parameter)
{
AtspiAccessible *current = flat_navi_context_current_get(ctx);
- fail_if(!current || current != child1);
+ fail_if(!current || current != child5);
}
END_TEST
+
START_TEST(spi_flat_navi_context_next_null_parameter)
{
AtspiAccessible *next = flat_navi_context_next(NULL);
START_TEST(spi_flat_navi_context_next_valid_parameter)
{
AtspiAccessible *next = flat_navi_context_next(ctx);
+
+ fail_if(!next || next != child6);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_next_valid_parameter2)
+{
+ AtspiAccessible *next = flat_navi_context_next(ctx);
+
+ fail_if(!next || next != child13);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_next_valid_parameter3)
+{
+ AtspiAccessible *next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+
+ fail_if(!next || next != child16);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_next_valid_parameter4)
+{
+ AtspiAccessible *next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+
+ fail_if(!next || next != child19);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_next_valid_parameter5)
+{
+ AtspiAccessible *next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+
+ fail_if(!next || next != child22);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_next_valid_parameter6)
+{
+ AtspiAccessible *next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+ next = flat_navi_context_next(ctx);
+
fail_if(!next || next != child2);
}
END_TEST
START_TEST(spi_flat_navi_context_prev_valid_parameter)
{
AtspiAccessible *prev = flat_navi_context_prev(ctx);
- fail_if(prev);
- flat_navi_context_current_set(ctx, child4);
- prev = flat_navi_context_prev(ctx);
- fail_if(!prev || prev != child3);
+ fail_if(!prev || prev != child6);
+}
+END_TEST
+
+START_TEST(spi_flat_navi_context_prev_valid_parameter2)
+{
+ AtspiAccessible *prev = flat_navi_context_prev(ctx);
+ fail_if(!prev || prev != child22);
}
END_TEST
+START_TEST(spi_flat_navi_context_prev_valid_parameter3)
+{
+ AtspiAccessible *prev = flat_navi_context_prev(ctx);
+ prev = flat_navi_context_prev(ctx);
+ fail_if(!prev || prev != child19);
+}
+END_TEST
+/*
START_TEST(spi_flat_navi_context_last_null_parameter)
{
AtspiAccessible *last = flat_navi_context_last(NULL);
fail_if(!last || last != child3);
}
END_TEST
-
+*/
Suite *screen_reader_suite(void)
{
Suite *s;
TCase *tc_spi_screen_reader_on_caret_move;
TCase *tc_spi_screen_reader_on_access_value;
TCase *tc_spi_screen_reader_flat_navi;
+ TCase *tc_spi_screen_reader_flat_navi2;
s = suite_create("Screen reader");
tc_spi_screen_reader_init = tcase_create("tc_spi_screen_reader_init");
tc_spi_screen_reader_on_caret_move = tcase_create("tc_spi_screen_reader_on_caret_move");
tc_spi_screen_reader_on_access_value = tcase_create("tc_spi_screen_reader_on_access_value");
tc_spi_screen_reader_flat_navi = tcase_create("tc_scpi_screen_reader_flat_navi");
+ tc_spi_screen_reader_flat_navi2 = tcase_create("tc_scpi_screen_reader_flat_navi2");
tcase_add_checked_fixture(tc_spi_screen_reader_init, setup, teardown);
tcase_add_checked_fixture(tc_spi_screen_reader_on_state_changed, setup, teardown);
tcase_add_checked_fixture(tc_spi_screen_reader_on_caret_move, setup, teardown);
tcase_add_checked_fixture(tc_spi_screen_reader_on_access_value, setup, teardown);
- tcase_add_checked_fixture(tc_spi_screen_reader_flat_navi, setup_flat_navi, teardown_flat_navi);
+ tcase_add_checked_fixture(tc_spi_screen_reader_flat_navi, setup_flat_navi2, teardown_flat_navi);
+ tcase_add_checked_fixture(tc_spi_screen_reader_flat_navi2, setup_flat_navi3, teardown_flat_navi);
tcase_add_test(tc_spi_screen_reader_init, spi_init_null_parameter);
tcase_add_test(tc_spi_screen_reader_init, spi_init_service_data_parameter);
tcase_add_test(tc_spi_screen_reader_on_state_changed, spi_on_state_change_role);
tcase_add_test(tc_spi_screen_reader_on_caret_move, spi_on_caret_move);
tcase_add_test(tc_spi_screen_reader_on_access_value, spi_on_value_changed);
-
tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_create_null_parameter);
tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_create_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_get_current_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_get_current_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_next_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_next_valid_parameter);
+
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_get_current_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_get_current_valid_parameter);
+
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_next_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_next_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_next_valid_parameter2);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_next_valid_parameter3);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_next_valid_parameter4);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_next_valid_parameter5);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_next_valid_parameter6);
+
tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_prev_null_parameter);
tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_prev_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_last_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_last_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_first_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_first_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_current_set_null_parameters);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_current_set_valid_parameters);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_prev_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_prev_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_next_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_next_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_first_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_first_valid_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_last_null_parameter);
- tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_last_valid_parameter);
-
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_prev_valid_parameter2);
+ tcase_add_test(tc_spi_screen_reader_flat_navi2, spi_flat_navi_context_prev_valid_parameter3);
+ /*
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_last_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_last_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_first_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_first_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_current_set_null_parameters);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_current_set_valid_parameters);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_prev_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_prev_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_next_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_next_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_first_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_first_valid_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_last_null_parameter);
+ tcase_add_test(tc_spi_screen_reader_flat_navi, spi_flat_navi_context_line_last_valid_parameter);
+ */
suite_add_tcase(s, tc_spi_screen_reader_init);
suite_add_tcase(s, tc_spi_screen_reader_on_state_changed);
suite_add_tcase(s, tc_spi_screen_reader_on_caret_move);
suite_add_tcase(s, tc_spi_screen_reader_on_access_value);
suite_add_tcase(s, tc_spi_screen_reader_flat_navi);
+ suite_add_tcase(s, tc_spi_screen_reader_flat_navi2);
return s;
}