kimcinoo pushed a commit to branch master.
commit ef4a2e4227f481b2fe6f18ae41b5fae68f3db3c8
Author: Shinwoo Kim <[email protected]>
Date: Tue Sep 10 14:01:50 2013 +0900
[access] enhancement - refine function name to
_elm_access_auto_highlight_set from _elm_access_read_mode_set
---
src/lib/elm_access.c | 26 +++++++++++++-------------
src/lib/elm_widget.c | 12 +++++++++---
src/lib/elm_widget.h | 9 ++++-----
3 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index 164039c..4c8cf89 100644
--- a/src/lib/elm_access.c
+++ b/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/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 840b027..cf008f8 100644
--- a/src/lib/elm_widget.c
+++ b/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/src/lib/elm_widget.h b/src/lib/elm_widget.h
index ef41e15..e4d6362 100644
--- a/src/lib/elm_widget.h
+++ b/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);
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk