2013-01-26 Daniel Juyung Seo (SeoZ)
* Add elm_index_delay_change_time_set/get for changing delay change time in index.
+
+2013-01-28 Shinwoo Kim
+
+ * [access] The read next/prev message does not move focus but move highlight only. the focus moves when the activate message is detected.
#define MY_CLASS_NAME "elm_access"
static Eina_Bool mouse_event_enable = EINA_TRUE;
+static Eina_Bool read_mode = EINA_FALSE;
static Evas_Object * _elm_access_add(Evas_Object *parent);
mouse_event_enable = enabled;
}
+void _elm_access_read_mode_set(Eina_Bool enabled)
+{
+ enabled = !!enabled;
+ if (read_mode == enabled) return;
+ read_mode = enabled;
+}
+
+Eina_Bool _elm_access_read_mode_get()
+{
+ return read_mode;
+}
//-------------------------------------------------------------------------//
EAPI void
_elm_access_highlight_set(Evas_Object* obj)
if (elm_widget_is(highlight))
{
+ _elm_access_read_mode_set(EINA_FALSE);
+
+ if (!elm_object_focus_get(highlight))
+ elm_object_focus_set(highlight, EINA_TRUE);
+
elm_widget_activate(highlight, act);
return;
}
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_access_read_mode_set(EINA_TRUE);
elm_widget_focus_cycle(obj, dir);
}
if (ptarget)
{
evas_object_data_del(o, "_elm_access_target");
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
+
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_DEL,
_access_obj_hilight_del_cb, NULL);
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_HIDE,
}
}
evas_object_data_set(o, "_elm_access_target", obj);
+ elm_widget_parent_highlight_set(obj, EINA_TRUE);
elm_widget_theme_object_set(obj, o, "access", "base", "default");
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE,
_access_obj_hilight_resize_cb, NULL);
evas_object_del(o);
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
}
}
_access_obj_hilight_resize_cb, NULL);
}
evas_object_del(o);
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
}
EAPI void
ELM_WIDGET_DATA_GET(obj, sd); \
if (!sd) return
+#define ELM_WIDGET_FOCUS_GET(obj) \
+ ((_elm_access_read_mode_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;
*ret = sd->focused;
}
+EAPI Eina_Bool
+elm_widget_highlight_get(const Evas_Object *obj)
+{
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_highlight_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_highlight_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->highlighted;
+}
+
EAPI Evas_Object *
elm_widget_focused_object_get(const Evas_Object *obj)
{
return;
elm_widget_focus_next_get(obj, dir, &target);
if (target)
- elm_widget_focus_steal(target);
+ {
+ /* access */
+ if (_elm_config->access_mode && _elm_access_read_mode_get())
+ _elm_access_highlight_set(target);
+ else elm_widget_focus_steal(target);
+ }
}
/**
/* Return */
*next = (Evas_Object *)obj;
- *ret = !elm_widget_focus_get(obj);
+ *ret = !ELM_WIDGET_FOCUS_GET(obj);
}
/**
const Eina_List *l = items;
/* Recovery last focused sub item */
- if (elm_widget_focus_get(obj))
+ if (ELM_WIDGET_FOCUS_GET(obj))
{
for (; l; l = list_next(l))
{
Evas_Object *cur = list_data_get(l);
- if (elm_widget_focus_get(cur)) break;
+ if (ELM_WIDGET_FOCUS_GET(cur)) break;
}
/* Focused object, but no focused sub item */
}
EAPI void
+elm_widget_parent_highlight_set(Evas_Object *obj,
+ Eina_Bool highlighted)
+{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_parent_highlight_set(highlighted));
+}
+
+
+static void
+_elm_widget_parent_highlight_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool highlighted = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
+ highlighted = !!highlighted;
+
+ Evas_Object *o = elm_widget_parent_get(obj);
+
+ if (o) elm_widget_parent_highlight_set(o, highlighted);
+
+ sd->highlighted = highlighted;
+}
+
+EAPI void
elm_widget_signal_emit(Evas_Object *obj,
const char *emission,
const char *source)
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_GET), _elm_widget_can_focus_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET), _elm_widget_child_can_focus_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_GET), _elm_widget_focus_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_GET), _elm_widget_highlight_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET), _elm_widget_focused_object_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOP_GET), _elm_widget_top_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET), _elm_widget_focus_list_direction_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET), _elm_widget_focus_next_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET), _elm_widget_focus_list_next_get),
-
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_HIGHLIGHT_SET), _elm_widget_parent_highlight_set),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET), _elm_widget_display_mode_set),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET), _elm_widget_display_mode_get),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TOP_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT_WIDGET_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET, "Get near object in one direction of base object in list."),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET, "Get next object in focus chain of object tree."),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET, "Get next object in focus chain of object tree in list."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT_HIGHLIGHT_SET, "Set highlighted value from itself to top parent object."),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET, "Sets the widget and child widget's Evas_Display_Mode."),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET, "Returns the widget's Evas_Display_Mode"),
* default */
Eina_Bool still_in : 1;
Eina_Bool can_access : 1;
+ Eina_Bool highlighted : 1;
} Elm_Widget_Smart_Data;
/**
};
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();
EAPI void _elm_access_clear(Elm_Access_Info *ac);
EAPI void _elm_access_text_set(Elm_Access_Info *ac, int type, const char *text);
EAPI void _elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Info_Cb func, const void *data);
EAPI void elm_widget_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight);
EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj);
EAPI Eina_Bool elm_widget_focus_get(const Evas_Object *obj);
+EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj);
EAPI Evas_Object *elm_widget_focused_object_get(const Evas_Object *obj);
EAPI Evas_Object *elm_widget_top_get(const Evas_Object *obj);
EAPI Eina_Bool elm_widget_is(const Evas_Object *obj);
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_direction_get(const Evas_Object *obj, const Evas_Object *base, const Eina_List *items, void *(*list_data_get)(const Eina_List *list), double degree, Evas_Object **direction, double *weight);
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 void elm_widget_parent_highlight_set(Evas_Object *obj, Eina_Bool highlighted);
EAPI void elm_widget_focus_set(Evas_Object *obj, int first);
EAPI void elm_widget_focused_object_clear(Evas_Object *obj);
EAPI Evas_Object *elm_widget_parent_get(const Evas_Object *obj);
ELM_WIDGET_SUB_ID_CAN_FOCUS_GET,
ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET,
ELM_WIDGET_SUB_ID_FOCUS_GET,
+ ELM_WIDGET_SUB_ID_HIGHLIGHT_GET,
ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET,
ELM_WIDGET_SUB_ID_TOP_GET,
ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET,
ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET,
ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET,
+ ELM_WIDGET_SUB_ID_PARENT_HIGHLIGHT_SET,
ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET,
ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET,
#define elm_wdg_focus_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
+ * @def elm_wdg_highlight_get
+ * @since 1.8
+ *
+ * No description supplied by the EAPI.
+ *
+ * @param[out] ret
+ *
+ */
+#define elm_wdg_highlight_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
* @def elm_wdg_focused_object_get
* @since 1.8
*
*/
#define elm_wdg_focus_list_next_get(items, list_data_get, dir, next, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET), EO_TYPECHECK(const Eina_List *, items), EO_TYPECHECK(list_data_get_func_type, list_data_get), EO_TYPECHECK(Elm_Focus_Direction, dir), EO_TYPECHECK(Evas_Object **, next), EO_TYPECHECK(Eina_Bool *, ret)
+/**
+ * @def elm_wdg_parent_highlight_set
+ * @since 1.8
+ *
+ * No description supplied by the EAPI.
+ *
+ * @param[in] highlighted
+ *
+ */
+#define elm_wdg_parent_highlight_set(highlighted) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_HIGHLIGHT_SET), EO_TYPECHECK(Eina_Bool, highlighted)
/**
* @def elm_wdg_display_mode_set