From 8c5cf54d2092012e2b85fedd40872fa928edefb9 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Mon, 27 May 2013 21:07:16 +0900 Subject: [PATCH] [mapbuf][access] add accessibility feature Change-Id: I16f89fd65ebc5bb8fe4f686c15d72acd88d5e7dc --- src/lib/elm_mapbuf.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 7d0f7f3..a7b31e9 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -231,6 +231,32 @@ _elm_mapbuf_smart_add(Evas_Object *obj) _sizing_eval(obj); } +static Eina_Bool +_elm_mapbuf_smart_focus_next(const Evas_Object *obj, + Elm_Focus_Direction dir, + Evas_Object **next) +{ + ELM_MAPBUF_CHECK(obj) EINA_FALSE; + ELM_MAPBUF_DATA_GET(obj, sd); + + if (sd->content) + return elm_widget_focus_next_get(sd->content, dir, next); + + return EINA_FALSE; +} + +static void +_elm_mapbuf_smart_access(Evas_Object *obj, Eina_Bool is_access) +{ + ELM_MAPBUF_DATA_GET(obj, sd); + + if (is_access) + ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = + _elm_mapbuf_smart_focus_next; + else + ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL; +} + static void _elm_mapbuf_smart_set_user(Elm_Mapbuf_Smart_Class *sc) { @@ -240,6 +266,10 @@ _elm_mapbuf_smart_set_user(Elm_Mapbuf_Smart_Class *sc) ELM_WIDGET_CLASS(sc)->theme = _elm_mapbuf_smart_theme; ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_mapbuf_smart_sub_object_del; + ELM_WIDGET_CLASS(sc)->access = _elm_mapbuf_smart_access; + + if (_elm_config->access_mode) + ELM_WIDGET_CLASS(sc)->focus_next = _elm_mapbuf_smart_focus_next; ELM_CONTAINER_CLASS(sc)->content_set = _elm_mapbuf_smart_content_set; ELM_CONTAINER_CLASS(sc)->content_get = _elm_mapbuf_smart_content_get; -- 2.7.4