From 0a1d984d9bbbb13ca52a9bec7cca36c2e76f4bb8 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Fri, 8 Feb 2013 06:16:03 +0000 Subject: [PATCH] [access] unregister an object from application side. SVN revision: 83761 --- legacy/elementary/src/bin/test.c | 3 +++ legacy/elementary/src/lib/elm_access.c | 32 ++++++++++++++++++++++---------- legacy/elementary/src/lib/elm_label.c | 5 +++-- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/legacy/elementary/src/bin/test.c b/legacy/elementary/src/bin/test.c index f62d5ca..465a23a 100644 --- a/legacy/elementary/src/bin/test.c +++ b/legacy/elementary/src/bin/test.c @@ -413,6 +413,9 @@ my_win_main(char *autorun, Eina_Bool test_win_only) elm_object_content_set(fr, lb); evas_object_show(lb); + /* This label will not be read out */ + elm_access_object_unregister(lb); + tg = elm_check_add(win); elm_object_style_set(tg, "toggle"); elm_object_text_set(tg, "UI-Mirroring:"); diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c index b85f511..9ab964e 100644 --- a/legacy/elementary/src/lib/elm_access.c +++ b/legacy/elementary/src/lib/elm_access.c @@ -662,25 +662,35 @@ _access_object_register(Evas_Object *obj, Evas_Object *parent) static void _access_object_unregister(Evas_Object *obj) { + Elm_Access_Info *ac; Evas_Object *ao; if (!obj) return; ao = evas_object_data_get(obj, "_part_access_obj"); - if (!ao) return; - evas_object_data_del(obj, "_part_access_obj"); + if (ao) + { + evas_object_data_del(obj, "_part_access_obj"); - /* delete callbacks */ - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, - _content_resize, ao); - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, - _content_move, ao); + /* delete callbacks */ + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, + _content_resize, ao); + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, + _content_move, ao); - /* unregister access object */ - _elm_access_object_unregister(ao, obj); + /* unregister access object */ + _elm_access_object_unregister(ao, obj); - evas_object_del(ao); + evas_object_del(ao); + } + else + { + /* button, check, label etc. */ + ac = evas_object_data_get(obj, "_elm_access"); + if (ac && ac->hoverobj) + _elm_access_object_unregister(obj, ac->hoverobj); + } } EAPI Evas_Object * @@ -753,6 +763,8 @@ _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj) _access_obj_del_cb, obj); ac = calloc(1, sizeof(Elm_Access_Info)); evas_object_data_set(obj, "_elm_access", ac); + + ac->hoverobj = hoverobj; } EAPI void diff --git a/legacy/elementary/src/lib/elm_label.c b/legacy/elementary/src/lib/elm_label.c index 7dc280d..3c717ab 100644 --- a/legacy/elementary/src/lib/elm_label.c +++ b/legacy/elementary/src/lib/elm_label.c @@ -392,11 +392,12 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) edje_object_signal_callback_add(wd->resize_obj, "elm,state,slide,end", "", _on_slide_end, obj); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj)); elm_layout_text_set(obj, NULL, "
"); + /* access */ + elm_widget_can_focus_set(obj, _elm_config->access_mode); + _elm_access_object_register(obj, wd->resize_obj); _elm_access_text_set (_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Label")); -- 2.7.4