[access] enhance access features

1. add access lines for ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ
  2. add _elm_access_highlight_cycle(); becase there is a case that
     highlight object would be different with focused object after
     user moves finger to specific object which does not have focus
     currently.


SVN revision: 79884
This commit is contained in:
Shinwoo Kim 2012-11-30 11:50:52 +00:00
parent afef01a765
commit 80d7b56b1f
3 changed files with 40 additions and 6 deletions

View File

@ -229,7 +229,18 @@ _access_obj_hilight_resize_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Ob
evas_object_resize(o, w, h);
}
static Evas_Object *
_access_highlight_object_get(Evas_Object *obj)
{
Evas_Object *o, *ho;
o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
if (!o) return NULL;
ho = evas_object_data_get(o, "_elm_access_target");
return ho;
}
//-------------------------------------------------------------------------//
EAPI void
@ -299,9 +310,27 @@ _elm_access_activate_callback_set(Elm_Access_Info *ac,
EAPI void
_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
{
Evas_Object *highlight_obj;
highlight_obj = elm_widget_focused_object_get(obj);
elm_widget_activate(highlight_obj, act);
Evas_Object *highlight;
highlight = _access_highlight_object_get(obj);
if (!highlight) return;
elm_widget_activate(highlight, act);
}
EAPI void
_elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
{
Evas_Object *highlight, *focused;
highlight = _access_highlight_object_get(obj);
focused = elm_widget_focused_object_get(obj);
if (highlight && (highlight != focused))
elm_object_focus_set(highlight, EINA_TRUE);
/* use focus cycle to read next, previous object */
elm_widget_focus_cycle(obj, dir);
}
EAPI char *

View File

@ -521,6 +521,7 @@ EAPI void _elm_access_widget_item_unregister(Elm_Widget_Item *item);
EAPI void _elm_access_on_highlight_hook_set(Elm_Access_Info *ac, Elm_Access_On_Highlight_Cb func, void *data);
EAPI void _elm_access_activate_callback_set(Elm_Access_Info *ac, Elm_Access_Activate_Cb func, void *data);
EAPI void _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act);
EAPI void _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
/**< put this as the first member in your widget item struct */
#define ELM_WIDGET_ITEM Elm_Widget_Item base

View File

@ -1890,17 +1890,21 @@ _elm_win_client_message(void *data,
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
{
// XXX: call right access func
/* there would be better way to read highlight object */
int x, y;
ecore_x_pointer_xy_get(sd->x.xwin, &x, &y);
ecore_x_mouse_in_send(sd->x.xwin, x, y);
ecore_x_mouse_move_send(sd->x.xwin, x, y);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
{
// XXX: call right access func
_elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
{
// XXX: call right access func
_elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)