From 34de4d619d7d1f1ee040f0563a4e69d37bec7f7c Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Tue, 10 Sep 2013 14:01:50 +0900 Subject: [PATCH] [access] enhancement - refine function name to _elm_access_auto_highlight_set from _elm_access_read_mode_set --- legacy/elementary/src/lib/elm_access.c | 26 +++++++++++++------------- legacy/elementary/src/lib/elm_widget.c | 12 +++++++++--- legacy/elementary/src/lib/elm_widget.h | 9 ++++----- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c index 164039cf10..4c8cf89e52 100644 --- a/legacy/elementary/src/lib/elm_access.c +++ b/legacy/elementary/src/lib/elm_access.c @@ -26,7 +26,7 @@ struct _Action_Info typedef struct _Action_Info Action_Info; static Eina_Bool mouse_event_enable = EINA_TRUE; -static Eina_Bool read_mode = EINA_FALSE; +static Eina_Bool auto_highlight = EINA_FALSE; static Elm_Access_Action_Type action_by = ELM_ACCESS_ACTION_FIRST; static Evas_Object * _elm_access_add(Evas_Object *parent); @@ -396,17 +396,17 @@ _elm_access_mouse_event_enabled_set(Eina_Bool enabled) } void -_elm_access_read_mode_set(Eina_Bool enabled) +_elm_access_auto_highlight_set(Eina_Bool enabled) { enabled = !!enabled; - if (read_mode == enabled) return; - read_mode = enabled; + if (auto_highlight == enabled) return; + auto_highlight = enabled; } Eina_Bool -_elm_access_read_mode_get() +_elm_access_auto_highlight_get(void) { - return read_mode; + return auto_highlight; } void @@ -501,7 +501,7 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir) } while (parent); - _elm_access_read_mode_set(EINA_TRUE); + _elm_access_auto_highlight_set(EINA_TRUE); if (dir == ELM_FOCUS_NEXT) type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT; @@ -539,7 +539,7 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir) action_by = ELM_ACCESS_ACTION_FIRST; - _elm_access_read_mode_set(EINA_FALSE); + _elm_access_auto_highlight_set(EINA_FALSE); return ret; } @@ -625,7 +625,7 @@ _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act) highlight = _access_highlight_object_get(obj); if (!highlight) return; - _elm_access_read_mode_set(EINA_FALSE); + _elm_access_auto_highlight_set(EINA_FALSE); if (!elm_object_focus_get(highlight)) elm_object_focus_set(highlight, EINA_TRUE); @@ -660,7 +660,7 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) } while (parent); - _elm_access_read_mode_set(EINA_TRUE); + _elm_access_auto_highlight_set(EINA_TRUE); if (dir == ELM_FOCUS_NEXT) type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT; @@ -693,7 +693,7 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) action_by = ELM_ACCESS_ACTION_FIRST; - _elm_access_read_mode_set(EINA_FALSE); + _elm_access_auto_highlight_set(EINA_FALSE); } EAPI char * @@ -1295,9 +1295,9 @@ elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, Elm_Acces evas = evas_object_evas_get(obj); if (!evas) return EINA_FALSE; - _elm_access_mouse_event_enabled_set(EINA_TRUE); - evas_event_feed_mouse_in(evas, 0, NULL); + + _elm_access_mouse_event_enabled_set(EINA_TRUE); evas_event_feed_mouse_move(evas, a->x, a->y, 0, NULL); _elm_access_mouse_event_enabled_set(EINA_FALSE); diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 840b027103..cf008f855a 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -26,8 +26,8 @@ EAPI Eo_Op ELM_WIDGET_BASE_ID = EO_NOOP; if (!sd) return #define ELM_WIDGET_FOCUS_GET(obj) \ - ((_elm_access_read_mode_get()) ? (elm_widget_highlight_get(obj)) : \ - (elm_widget_focus_get(obj))) + ((_elm_access_auto_highlight_get()) ? (elm_widget_highlight_get(obj)) : \ + (elm_widget_focus_get(obj))) typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data; typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data; @@ -2019,8 +2019,14 @@ _elm_widget_focus_cycle(Eo *obj, void *_pd EINA_UNUSED, va_list *list) if (target) { /* access */ - if (_elm_config->access_mode && _elm_access_read_mode_get()) + if (_elm_config->access_mode) { + /* highlight cycle does not steal a focus, only after window gets + the ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE message, + target will steal focus, or focus its own job. */ + if (!_elm_access_auto_highlight_get()) + elm_widget_focus_steal(target); + _elm_access_highlight_set(target); elm_widget_focus_region_show(target); } diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index ef41e1535b..e4d6362934 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -501,11 +501,10 @@ struct _Elm_Access_Info void _elm_access_shutdown(); void _elm_access_mouse_event_enabled_set(Eina_Bool enabled); -/* elm_widget_focus_list_next_get();, elm_widget_focus_next_get(); - and elm_widget_focus_cycle(); use _elm_access_read_mode to use - focus chain */ -void _elm_access_read_mode_set(Eina_Bool enabled); -Eina_Bool _elm_access_read_mode_get(); + +/* if auto_higlight is EINA_TRUE, it does not steal a focus, it just moves a highlight */ +void _elm_access_auto_highlight_set(Eina_Bool enabled); +Eina_Bool _elm_access_auto_highlight_get(void); void _elm_access_widget_item_access_order_set(Elm_Widget_Item *item, Eina_List *objs); const Eina_List *_elm_access_widget_item_access_order_get(const Elm_Widget_Item *item); void _elm_access_widget_item_access_order_unset(Elm_Widget_Item *item);