summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorShinwoo Kim <kimcinoo.efl@gmail.com>2012-11-19 13:08:54 +0000
committerShinwoo Kim <kimcinoo.efl@gmail.com>2012-11-19 13:08:54 +0000
commitf81147a18ee99c53f465dda1ebbb602e746034fb (patch)
tree1e4d914a892e6fa44200511319d6174b5b4896a7 /legacy
parent0483d05865c2b4d34d67b1b02497f0ca1ff837a1 (diff)
[access] enhance access feature
1. add _elm_access_object_unregister(); api. 2. unregister access object properly when unregister widget item. 3. modify improper access object check. 4. [list] add smart_access(); lines to provide run time register, unregister. 5. [genlist] unregister access object when genlist item is unrealized. SVN revision: 79444
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_access.c46
-rw-r--r--legacy/elementary/src/lib/elm_genlist.c6
-rw-r--r--legacy/elementary/src/lib/elm_list.c50
-rw-r--r--legacy/elementary/src/lib/elm_widget.h3
4 files changed, 71 insertions, 34 deletions
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index c35a48b..c6c8a91 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -164,21 +164,7 @@ _access_obj_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
164static void 164static void
165_access_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) 165_access_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
166{ 166{
167 Elm_Access_Info *ac; 167 _elm_access_object_unregister(data, obj);
168
169 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_IN,
170 _access_obj_mouse_in_cb, data);
171 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_OUT,
172 _access_obj_mouse_out_cb, data);
173 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
174 _access_obj_del_cb, data);
175 ac = evas_object_data_get(data, "_elm_access");
176 evas_object_data_del(data, "_elm_access");
177 if (ac)
178 {
179 _elm_access_clear(ac);
180 free(ac);
181 }
182 168
183 // _elm_access_edje_object_part_object_register(); set below object data 169 // _elm_access_edje_object_part_object_register(); set below object data
184 evas_object_data_del(obj, "_part_access_obj"); 170 evas_object_data_del(obj, "_part_access_obj");
@@ -640,6 +626,27 @@ _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj)
640 evas_object_data_set(obj, "_elm_access", ac); 626 evas_object_data_set(obj, "_elm_access", ac);
641} 627}
642 628
629EAPI void
630_elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj)
631{
632 Elm_Access_Info *ac;
633
634 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_IN,
635 _access_obj_mouse_in_cb, obj);
636 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_OUT,
637 _access_obj_mouse_out_cb, obj);
638 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_DEL,
639 _access_obj_del_cb, obj);
640
641 ac = evas_object_data_get(obj, "_elm_access");
642 evas_object_data_del(obj, "_elm_access");
643 if (ac)
644 {
645 _elm_access_clear(ac);
646 free(ac);
647 }
648}
649
643static Eina_Bool 650static Eina_Bool
644_access_item_over_timeout_cb(void *data) 651_access_item_over_timeout_cb(void *data)
645{ 652{
@@ -727,6 +734,10 @@ _elm_access_widget_item_register(Elm_Widget_Item *item)
727 734
728 if (!item) return; 735 if (!item) return;
729 736
737 /* check previous access object */
738 if (item->access_obj)
739 _elm_access_widget_item_unregister(item);
740
730 // create access object 741 // create access object
731 ho = item->view; 742 ho = item->view;
732 ao = _elm_access_add(item->widget); 743 ao = _elm_access_add(item->widget);
@@ -755,7 +766,7 @@ _elm_access_widget_item_unregister(Elm_Widget_Item *item)
755{ 766{
756 Evas_Object *ho; 767 Evas_Object *ho;
757 768
758 if (!item || item->access_obj) return; 769 if (!item || !item->access_obj) return;
759 770
760 ho = item->view; 771 ho = item->view;
761 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_RESIZE, 772 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_RESIZE,
@@ -763,7 +774,10 @@ _elm_access_widget_item_unregister(Elm_Widget_Item *item)
763 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_MOVE, 774 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_MOVE,
764 _content_move, item->access_obj); 775 _content_move, item->access_obj);
765 776
777 _elm_access_object_unregister(item->access_obj, ho);
778
766 evas_object_del(item->access_obj); 779 evas_object_del(item->access_obj);
780 item->access_obj = NULL;
767} 781}
768 782
769EAPI void 783EAPI void
diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c
index 563a492..ccbc6c1 100644
--- a/legacy/elementary/src/lib/elm_genlist.c
+++ b/legacy/elementary/src/lib/elm_genlist.c
@@ -4204,6 +4204,10 @@ _item_unrealize_cb(Elm_Gen_Item *it)
4204 EINA_LIST_FREE (it->item->flip_content_objs, content) 4204 EINA_LIST_FREE (it->item->flip_content_objs, content)
4205 evas_object_del(content); 4205 evas_object_del(content);
4206 4206
4207 /* access */
4208 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
4209 _elm_access_widget_item_unregister((Elm_Widget_Item *)it);
4210
4207 // unswallow VIEW(it) first then manipulate VIEW(it) 4211 // unswallow VIEW(it) first then manipulate VIEW(it)
4208 _decorate_item_unrealize(it); 4212 _decorate_item_unrealize(it);
4209 if (GL_IT(it)->wsd->decorate_all_mode) _decorate_all_item_unrealize(it); 4213 if (GL_IT(it)->wsd->decorate_all_mode) _decorate_all_item_unrealize(it);
@@ -4685,7 +4689,7 @@ _elm_genlist_smart_member_add(Evas_Object *obj,
4685} 4689}
4686 4690
4687static void 4691static void
4688_access_obj_process(Elm_Genlist_Smart_Data * sd, Eina_Bool is_access) 4692_access_obj_process(Elm_Genlist_Smart_Data *sd, Eina_Bool is_access)
4689{ 4693{
4690 Item_Block *itb; 4694 Item_Block *itb;
4691 Eina_Bool done = EINA_FALSE; 4695 Eina_Bool done = EINA_FALSE;
diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c
index b1099c6..7d76940 100644
--- a/legacy/elementary/src/lib/elm_list.c
+++ b/legacy/elementary/src/lib/elm_list.c
@@ -1364,6 +1364,25 @@ _access_on_highlight_cb(void *data)
1364 elm_list_item_bring_in(it); 1364 elm_list_item_bring_in(it);
1365} 1365}
1366 1366
1367static void
1368_access_widget_item_register(Elm_List_Item *it, Eina_Bool is_access)
1369{
1370 Elm_Access_Info *ai;
1371
1372 if (!is_access) _elm_access_widget_item_unregister((Elm_Widget_Item *)it);
1373 else
1374 {
1375 _elm_access_widget_item_register((Elm_Widget_Item *)it);
1376
1377 ai = _elm_access_object_get(it->base.access_obj);
1378
1379 _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("List Item"));
1380 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
1381 _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
1382 _elm_access_on_highlight_hook_set(ai, _access_on_highlight_cb, it);
1383 }
1384}
1385
1367static Elm_List_Item * 1386static Elm_List_Item *
1368_item_new(Evas_Object *obj, 1387_item_new(Evas_Object *obj,
1369 const char *label, 1388 const char *label,
@@ -1386,23 +1405,9 @@ _item_new(Evas_Object *obj,
1386 1405
1387 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 1406 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
1388 1407
1389 // ACCESS 1408 /* access */
1390 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 1409 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
1391 { 1410 _access_widget_item_register(it, EINA_TRUE);
1392 _elm_access_widget_item_register((Elm_Widget_Item *)it);
1393
1394 _elm_access_text_set(_elm_access_object_get(it->base.access_obj),
1395 ELM_ACCESS_TYPE, E_("List Item"));
1396 _elm_access_callback_set(_elm_access_object_get(it->base.access_obj),
1397 ELM_ACCESS_INFO,
1398 _access_info_cb, it);
1399 _elm_access_callback_set(_elm_access_object_get(it->base.access_obj),
1400 ELM_ACCESS_STATE,
1401 _access_state_cb, it);
1402 _elm_access_on_highlight_hook_set(
1403 _elm_access_object_get(it->base.access_obj), _access_on_highlight_cb,
1404 it);
1405 }
1406 1411
1407 edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(obj)); 1412 edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(obj));
1408 evas_object_event_callback_add 1413 evas_object_event_callback_add
@@ -1629,6 +1634,18 @@ _elm_list_smart_member_add(Evas_Object *obj,
1629} 1634}
1630 1635
1631static void 1636static void
1637_elm_list_smart_access(Evas_Object *obj, Eina_Bool is_access)
1638{
1639 Eina_List *elist = NULL;
1640 Elm_List_Item *it;
1641
1642 ELM_LIST_DATA_GET(obj, sd);
1643
1644 EINA_LIST_FOREACH(sd->items, elist, it)
1645 _access_widget_item_register(it, is_access);
1646}
1647
1648static void
1632_elm_list_smart_set_user(Elm_List_Smart_Class *sc) 1649_elm_list_smart_set_user(Elm_List_Smart_Class *sc)
1633{ 1650{
1634 ELM_WIDGET_CLASS(sc)->base.add = _elm_list_smart_add; 1651 ELM_WIDGET_CLASS(sc)->base.add = _elm_list_smart_add;
@@ -1645,6 +1662,7 @@ _elm_list_smart_set_user(Elm_List_Smart_Class *sc)
1645 ELM_WIDGET_CLASS(sc)->disable = _elm_list_smart_disable; 1662 ELM_WIDGET_CLASS(sc)->disable = _elm_list_smart_disable;
1646 ELM_WIDGET_CLASS(sc)->event = _elm_list_smart_event; 1663 ELM_WIDGET_CLASS(sc)->event = _elm_list_smart_event;
1647 ELM_WIDGET_CLASS(sc)->translate = _elm_list_smart_translate; 1664 ELM_WIDGET_CLASS(sc)->translate = _elm_list_smart_translate;
1665 ELM_WIDGET_CLASS(sc)->access = _elm_list_smart_access;
1648 1666
1649 ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_list_smart_sizing_eval; 1667 ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_list_smart_sizing_eval;
1650} 1668}
diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h
index 9c110c7..1a70143 100644
--- a/legacy/elementary/src/lib/elm_widget.h
+++ b/legacy/elementary/src/lib/elm_widget.h
@@ -598,8 +598,9 @@ EAPI void _elm_access_object_hilight(Evas_Object *obj);
598EAPI void _elm_access_object_unhilight(Evas_Object *obj); 598EAPI void _elm_access_object_unhilight(Evas_Object *obj);
599EAPI void _elm_access_object_hilight_disable(Evas *e); 599EAPI void _elm_access_object_hilight_disable(Evas *e);
600EAPI void _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj); 600EAPI void _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj);
601EAPI void _elm_access_item_unregister(Elm_Widget_Item *item); 601EAPI void _elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj);
602EAPI void _elm_access_item_register(Elm_Widget_Item *item, Evas_Object *hoverobj); 602EAPI void _elm_access_item_register(Elm_Widget_Item *item, Evas_Object *hoverobj);
603EAPI void _elm_access_item_unregister(Elm_Widget_Item *item);
603EAPI Eina_Bool _elm_access_2nd_click_timeout(Evas_Object *obj); 604EAPI Eina_Bool _elm_access_2nd_click_timeout(Evas_Object *obj);
604EAPI void _elm_access_highlight_set(Evas_Object* obj); 605EAPI void _elm_access_highlight_set(Evas_Object* obj);
605EAPI Evas_Object * _elm_access_edje_object_part_object_register(Evas_Object *obj, const Evas_Object *partobj, const char* part); 606EAPI Evas_Object * _elm_access_edje_object_part_object_register(Evas_Object *obj, const Evas_Object *partobj, const char* part);