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 Evas_Coord_Point offset;
static Evas_Object *s_parent; /* scrollable parent */
static Elm_Access_Action_Type action_by = ELM_ACCESS_ACTION_FIRST;
_access_obj_mouse_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Elm_Access_Info *ac;
+ Evas_Object *ho;
+
if (!mouse_event_enable) return;
ac = evas_object_data_get(data, "_elm_access");
}
if (_elm_config->access_mode)
- _elm_access_highlight_set(data);
+ {
+ ho = _access_highlight_object_get(data);
+ if (ho == data) return;
+
+ _access_highlight_read(ac, data);
+ }
}
static void
}
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()
{
- return read_mode;
+ return auto_highlight;
}
void
}
while (parent);
- _elm_access_read_mode_set(EINA_TRUE);
+ _elm_access_auto_highlight_set(EINA_TRUE);
ret = elm_widget_focus_next_get(obj, dir, &target);
if (ret && target)
}
}
- _elm_access_read_mode_set(EINA_FALSE);
+ _elm_access_auto_highlight_set(EINA_FALSE);
return ret;
}
_access_highlight_read(ac, obj);
- /* move mouse position to inside of highlight object. if an object has a
- highlight by highlight_cycle();, the mouse still positions at previous
- position which would be made by MOUSE_IN event. */
- if (!_elm_access_read_mode_get()) return;
-
evas = evas_object_evas_get(obj);
if (!evas) return;
+ /* move mouse position to inside of highlight object. if an object has a
+ highlight by highlight_cycle();, the mouse still positions at previous
+ position which would be made by MOUSE_IN event. */
evas_object_geometry_get(obj, &ho_point.x, &ho_point.y, 0, 0);
evas_event_feed_mouse_move(evas, ho_point.x, ho_point.y, 0, NULL);
}
case ELM_ACTIVATE_DEFAULT:
case ELM_ACTIVATE_UP:
case ELM_ACTIVATE_DOWN:
- _elm_access_read_mode_set(EINA_FALSE);
-
if (!elm_object_focus_get(ho))
elm_object_focus_set(ho, EINA_TRUE);
}
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;
action_by = ELM_ACCESS_ACTION_FIRST;
- _elm_access_read_mode_set(EINA_FALSE);
+ _elm_access_auto_highlight_set(EINA_FALSE);
}
EAPI char *
Evas *evas;
Evas_Object *ho;
Elm_Access_Action_Info *a;
- Eina_Bool ret;
+ Eina_Bool ret = EINA_FALSE;
a = (Elm_Access_Action_Info *) action_info;
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);
if (!sd) \
return
-#define ELM_WIDGET_FOCUS_GET(obj) \
- ((_elm_access_read_mode_get()) ? (elm_widget_highlight_get(obj)) : \
- (elm_widget_focus_get(obj)))
+#define 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;
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);
}
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 _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);