Added focus_direction_go entry in API.

Also, exported the focus_cycle.

SVN revision: 53659
This commit is contained in:
Tiago Rezende Campos Falcao 2010-10-20 12:38:27 +00:00
parent c04d655155
commit b8ac8c0e80
4 changed files with 64 additions and 7 deletions

View File

@ -258,6 +258,12 @@ extern "C" {
ELM_ICON_LOOKUP_THEME /**< icon look up order: theme */
} Elm_Icon_Lookup_Order;
typedef enum _Elm_Focus_Direction
{
ELM_FOCUS_PREVIOUS,
ELM_FOCUS_NEXT
} Elm_Focus_Direction;
/**
* Called back when a widget's tooltip is activated and needs content.
* @param data user-data given to elm_object_tooltip_content_cb_set()
@ -343,6 +349,8 @@ extern "C" {
EAPI const Eina_List *elm_object_focus_custom_chain_get(const Evas_Object *obj);
EAPI void elm_object_focus_custom_chain_append(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
EAPI void elm_object_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
EAPI void elm_object_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
EAPI void elm_object_focus_direction_go(Evas_Object *obj, int x, int y);
EAPI void elm_object_scroll_hold_push(Evas_Object *obj);
EAPI void elm_object_scroll_hold_pop(Evas_Object *obj);

View File

@ -1418,6 +1418,42 @@ elm_object_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas
elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
}
/**
* Give focus to next object in object tree.
*
* Give focus to next object in focus chain of one object sub-tree.
* If the last object of chain already have focus, the focus will go to the
* first object of chain.
*
* @param obj The object root of sub-tree
* @param dir Direction to cycle the focus
*
* @ingroup Focus
*/
EAPI void
elm_object_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
{
elm_widget_focus_cycle(obj, dir);
}
/**
* Give focus to near object in one direction.
*
* Give focus to near object in direction of one object.
* If none focusable object in given direction, the focus will not change.
*
* @param obj The reference object
* @param x Horizontal component of direction to focus
* @param y Vertical component of direction to focus
*
* @ingroup Widget
*/
EAPI void
elm_object_focus_direction_go(Evas_Object *obj, int x, int y)
{
elm_widget_focus_direction_go(obj, x, y);
}
/**
* @defgroup Scrollhints Scrollhints
*

View File

@ -956,12 +956,30 @@ elm_widget_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas
EAPI void
elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
{
Evas_Object *target;
Evas_Object *target = NULL;
elm_widget_focus_next_get(obj, dir, &target);
if (target)
elm_widget_focus_steal(target);
}
/**
* Give focus to near object in one direction.
*
* Give focus to near object in direction of one object.
* If none focusable object in given direction, the focus will not change.
*
* @param obj The reference widget
* @param x Horizontal component of direction to focus
* @param y Vertical component of direction to focus
*
* @ingroup Widget
*/
EAPI void
elm_widget_focus_direction_go(Evas_Object *obj __UNUSED__, int x __UNUSED__, int y __UNUSED__)
{
return; /* TODO */
}
/**
* Get next object in focus chain of object tree.
*

View File

@ -189,12 +189,6 @@ typedef struct _Elm_Tooltip Elm_Tooltip;
typedef struct _Elm_Cursor Elm_Cursor;
typedef struct _Elm_Widget_Item Elm_Widget_Item; /**< base structure for all widget items that are not Elm_Widget themselves */
typedef enum _Elm_Focus_Direction
{
ELM_FOCUS_PREVIOUS,
ELM_FOCUS_NEXT
} Elm_Focus_Direction;
struct _Elm_Widget_Item
{
/* ef1 ~~ efl, el3 ~~ elm */
@ -257,6 +251,7 @@ EAPI const Eina_List *elm_widget_focus_custom_chain_get(const Evas_Object *obj);
EAPI void elm_widget_focus_custom_chain_append(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
EAPI void elm_widget_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
EAPI void elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
EAPI void elm_widget_focus_direction_go(Evas_Object *obj, int x, int y);
EAPI Eina_Bool elm_widget_focus_next_get(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next);
EAPI Eina_Bool elm_widget_focus_list_next_get(const Evas_Object *obj, const Eina_List *items, void *(*list_data_get) (const Eina_List *list), Elm_Focus_Direction dir, Evas_Object **next);
EAPI int elm_widget_focus_jump(Evas_Object *obj, int forward);