*
* @return AtspiAccessible* pointer to current object
*
- * @note If current element is last in line function advances to
- * next line to first element.
- * @note If current element is last in last line, function returns NULL
+ * @note If current element is last in line function returns NULL
*/
AtspiAccessible *flat_navi_context_next(FlatNaviContext *ctx);
*
* @return AtspiAccessible* pointer to current object
*
- * @note If current element is first in line function advances to
- * previous line to last element.
- * @note If current element is first in first line, function returns NULL
+ * @note If current element is first in line function returns NULL
*/
AtspiAccessible *flat_navi_context_prev(FlatNaviContext *ctx);
/**
+ * Advances to last element in current line.
+ *
+ * @param ctx FlatNaviContext
+ *
+ * @return AtspiAccessible* pointer to current object
+ */
+AtspiAccessible *flat_navi_context_last(FlatNaviContext *ctx);
+
+/**
+ * Advances to first element in current line.
+ *
+ * @param ctx FlatNaviContext
+ *
+ * @return AtspiAccessible* pointer to current object
+ */
+AtspiAccessible *flat_navi_context_first(FlatNaviContext *ctx);
+
+/**
* Get current element
*
* @param ctx FlatNaviContext
*/
AtspiAccessible *flat_navi_context_line_last(FlatNaviContext *ctx);
-/**
- * Advances to the last element of the last line
- *
- * @param ctx FlatNaviContext
- *
- * @return AtspiAccessible* pointer to current object
- *
- * @note current element will be last of line
- */
-AtspiAccessible *flat_navi_context_line_last_object_last(FlatNaviContext *ctx);
-
#endif /* end of include guard: FLAT_NAVI_H_ */
Eina_List *new = eina_list_next(ctx->current);
if (new)
- {
- ctx->current = new;
- }
- else
- {
- AtspiAccessible *next = flat_navi_context_line_next(ctx);
- if (next)
- {
- return next;
- }
- else
{
- return flat_navi_context_line_first(ctx);
+ ctx->current = new;
+ return eina_list_data_get(ctx->current);
}
- }
-
- return eina_list_data_get(ctx->current);
+ return NULL;
}
AtspiAccessible *flat_navi_context_prev(FlatNaviContext *ctx)
Eina_List *new = eina_list_prev(ctx->current);
if (new)
- ctx->current = new;
- else
{
- if (!flat_navi_context_line_prev(ctx))
- {
- return flat_navi_context_line_last_object_last(ctx);
- }
- ctx->current = eina_list_last(eina_list_data_get(ctx->current_line));
+ ctx->current = new;
+ return eina_list_data_get(ctx->current);
}
+ return NULL;
+}
- return eina_list_data_get(ctx->current);
+AtspiAccessible *flat_navi_context_first(FlatNaviContext *ctx)
+{
+ Eina_List *new = eina_list_data_get(ctx->current_line);
+
+ if (new)
+ {
+ ctx->current = new;
+ return eina_list_data_get(ctx->current);
+ }
+ return NULL;
+}
+
+AtspiAccessible *flat_navi_context_last(FlatNaviContext *ctx)
+{
+ Eina_List *new = eina_list_last(ctx->current);
+
+ if (new)
+ {
+ ctx->current = new;
+ return eina_list_data_get(ctx->current);
+ }
+ return NULL;
}
AtspiAccessible *flat_navi_context_line_next(FlatNaviContext *ctx)
return eina_list_data_get(ctx->current);
}
-
-AtspiAccessible *flat_navi_context_line_last_object_last(FlatNaviContext *ctx)
-{
- Eina_List *new = eina_list_last(ctx->current_line);
-
- ctx->current_line = new;
- ctx->current = eina_list_last(eina_list_data_get(ctx->current_line));
-
- return eina_list_data_get(ctx->current);
-}
static void _focus_next(void)
{
+ AtspiAccessible *obj;
if (!context)
{
ERROR("No navigation context created");
return;
}
- AtspiAccessible *obj = flat_navi_context_next(context);
+ 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);
+ }
if (obj)
_current_highlight_object_set(obj);
else
static void _focus_prev(void)
{
+ AtspiAccessible *obj;
if (!context)
{
ERROR("No navigation context created");
return;
}
- AtspiAccessible *obj = flat_navi_context_prev(context);
+ 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);
+ }
if (obj)
_current_highlight_object_set(obj);
else