summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_access.c
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/elementary/src/lib/elm_access.c
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/elementary/src/lib/elm_access.c')
-rw-r--r--legacy/elementary/src/lib/elm_access.c46
1 files changed, 30 insertions, 16 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