summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/elementary/ChangeLog4
-rw-r--r--legacy/elementary/src/lib/elm_access.c130
2 files changed, 98 insertions, 36 deletions
diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog
index ea24b35cad..1718c8cbd1 100644
--- a/legacy/elementary/ChangeLog
+++ b/legacy/elementary/ChangeLog
@@ -1589,3 +1589,7 @@
15892013-09-04 Ryuan Choi (ryuan) 15892013-09-04 Ryuan Choi (ryuan)
1590 1590
1591 * elm_config : profile may be broken when clicked reset button in profiles tab 1591 * elm_config : profile may be broken when clicked reset button in profiles tab
1592
15932013-09-07 Shinwoo Kim
1594
1595 * elm_access : delete access object in job when its hover object is deleted
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index 684b9e38f7..164039cf10 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -292,7 +292,7 @@ _access_obj_over_timeout_cb(void *data)
292} 292}
293 293
294static void 294static void
295_access_obj_mouse_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 295_access_hover_mouse_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
296{ 296{
297 Elm_Access_Info *ac; 297 Elm_Access_Info *ac;
298 if (!mouse_event_enable) return; 298 if (!mouse_event_enable) return;
@@ -307,7 +307,7 @@ _access_obj_mouse_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
307} 307}
308 308
309static void 309static void
310_access_obj_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 310_access_hover_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
311{ 311{
312 Elm_Access_Info *ac; 312 Elm_Access_Info *ac;
313 if (!mouse_event_enable) return; 313 if (!mouse_event_enable) return;
@@ -321,13 +321,6 @@ _access_obj_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
321} 321}
322 322
323static void 323static void
324_access_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
325{
326 _elm_access_object_unregister(data, obj);
327 _access_object_unregister(obj);
328}
329
330static void
331_access_read_done(void *data __UNUSED__) 324_access_read_done(void *data __UNUSED__)
332{ 325{
333 DBG("read done"); 326 DBG("read done");
@@ -940,17 +933,7 @@ _access_object_unregister(Evas_Object *obj)
940 933
941 if (ao) 934 if (ao)
942 { 935 {
943 evas_object_data_del(obj, "_part_access_obj"); 936 /* delete callbacks and unregister access object in _access_obj_del_cb*/
944
945 /* delete callbacks */
946 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
947 _content_resize, ao);
948 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
949 _content_move, ao);
950
951 /* unregister access object */
952 _elm_access_object_unregister(ao, obj);
953
954 evas_object_del(ao); 937 evas_object_del(ao);
955 } 938 }
956 else 939 else
@@ -1019,17 +1002,86 @@ _elm_access_object_hilight_disable(Evas *e)
1019 elm_widget_parent_highlight_set(ptarget, EINA_FALSE); 1002 elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
1020} 1003}
1021 1004
1005static void
1006_access_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
1007{
1008
1009 Ecore_Job *ao_del_job = NULL;
1010
1011 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _access_obj_del_cb);
1012
1013 if (data) /* hover object */
1014 {
1015 evas_object_event_callback_del_full(data, EVAS_CALLBACK_RESIZE,
1016 _content_resize, obj);
1017 evas_object_event_callback_del_full(data, EVAS_CALLBACK_MOVE,
1018 _content_move, obj);
1019
1020 _elm_access_object_unregister(obj, data);
1021 }
1022
1023 ao_del_job = evas_object_data_get(obj, "_access_obj_del_job");
1024
1025 if (ao_del_job)
1026 {
1027 ecore_job_del(ao_del_job);
1028 evas_object_data_del(obj, "_access_obj_del_job");
1029 }
1030}
1031
1032static void
1033_access_obj_del_job(void *data)
1034{
1035 if (!data) return;
1036
1037 evas_object_data_del(data, "_access_obj_del_job");
1038
1039 evas_object_event_callback_del(data, EVAS_CALLBACK_DEL, _access_obj_del_cb);
1040 evas_object_del(data);
1041}
1042
1043static void
1044_access_hover_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
1045{
1046 Ecore_Job *ao_del_job = NULL;
1047
1048 /* data - access object - could be NULL */
1049 if (!data) return;
1050
1051 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
1052 _content_resize, data);
1053 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
1054 _content_move, data);
1055
1056 _elm_access_object_unregister(data, obj);
1057
1058 /* delete access object in job */
1059 ao_del_job = evas_object_data_get(data, "_access_obj_del_job");
1060 if (ao_del_job)
1061 {
1062 ecore_job_del(ao_del_job);
1063 evas_object_data_del(data, "_access_obj_del_job");
1064 }
1065
1066 ao_del_job = ecore_job_add(_access_obj_del_job, data);
1067 evas_object_data_set(data, "_access_obj_del_job", ao_del_job);
1068}
1069
1022EAPI void 1070EAPI void
1023_elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj) 1071_elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj)
1024{ 1072{
1025 Elm_Access_Info *ac; 1073 Elm_Access_Info *ac;
1026 1074
1027 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_MOUSE_IN, 1075 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_MOUSE_IN,
1028 _access_obj_mouse_in_cb, obj); 1076 _access_hover_mouse_in_cb, obj);
1029 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_MOUSE_OUT, 1077 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_MOUSE_OUT,
1030 _access_obj_mouse_out_cb, obj); 1078 _access_hover_mouse_out_cb, obj);
1031 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_DEL, 1079 evas_object_event_callback_add(hoverobj, EVAS_CALLBACK_DEL,
1032 _access_obj_del_cb, obj); 1080 _access_hover_del_cb, obj);
1081
1082 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1083 _access_obj_del_cb, hoverobj);
1084
1033 ac = calloc(1, sizeof(Elm_Access_Info)); 1085 ac = calloc(1, sizeof(Elm_Access_Info));
1034 evas_object_data_set(obj, "_elm_access", ac); 1086 evas_object_data_set(obj, "_elm_access", ac);
1035 1087
@@ -1040,18 +1092,29 @@ EAPI void
1040_elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj) 1092_elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj)
1041{ 1093{
1042 Elm_Access_Info *ac; 1094 Elm_Access_Info *ac;
1095 Evas_Object *ao;
1043 1096
1044 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_IN, 1097 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_IN,
1045 _access_obj_mouse_in_cb, obj); 1098 _access_hover_mouse_in_cb, obj);
1046 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_OUT, 1099 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_MOUSE_OUT,
1047 _access_obj_mouse_out_cb, obj); 1100 _access_hover_mouse_out_cb, obj);
1048 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_DEL, 1101 evas_object_event_callback_del_full(hoverobj, EVAS_CALLBACK_DEL,
1049 _access_obj_del_cb, obj); 1102 _access_hover_del_cb, obj);
1103
1104 /* _access_obj_del_cb and _access_hover_del_cb calls this function,
1105 both do not need _part_access_obj data, so delete the data here. */
1106 ao = evas_object_data_get(hoverobj, "_part_access_obj");
1107 if (ao) evas_object_data_del(hoverobj, "_part_access_obj");
1050 1108
1051 ac = evas_object_data_get(obj, "_elm_access"); 1109 ac = evas_object_data_get(obj, "_elm_access");
1052 evas_object_data_del(obj, "_elm_access"); 1110 evas_object_data_del(obj, "_elm_access");
1053 if (ac) 1111 if (ac)
1054 { 1112 {
1113 /* widget could delete VIEW(it) only and register item again,
1114 in this case _elm_access_widget_item_register could try to delete
1115 access object again in _elm_access_widget_item_unregister */
1116 if (ac->widget_item) ac->widget_item->access_obj = NULL;
1117
1055 _elm_access_clear(ac); 1118 _elm_access_clear(ac);
1056 free(ac); 1119 free(ac);
1057 } 1120 }
@@ -1103,22 +1166,17 @@ _elm_access_widget_item_register(Elm_Widget_Item *item)
1103EAPI void 1166EAPI void
1104_elm_access_widget_item_unregister(Elm_Widget_Item *item) 1167_elm_access_widget_item_unregister(Elm_Widget_Item *item)
1105{ 1168{
1106 Evas_Object *ho; 1169 Evas_Object *ao;
1107 1170
1108 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item); 1171 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
1109 1172
1110 if (!item->access_obj) return; 1173 if (!item->access_obj) return;
1111 1174
1112 ho = item->view; 1175 /* delete callbacks and unregister access object in _access_obj_del_cb*/
1113 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_RESIZE, 1176 ao = item->access_obj;
1114 _content_resize, item->access_obj);
1115 evas_object_event_callback_del_full(ho, EVAS_CALLBACK_MOVE,
1116 _content_move, item->access_obj);
1117
1118 _elm_access_object_unregister(item->access_obj, ho);
1119
1120 evas_object_del(item->access_obj);
1121 item->access_obj = NULL; 1177 item->access_obj = NULL;
1178
1179 evas_object_del(ao);
1122} 1180}
1123 1181
1124EAPI Eina_Bool 1182EAPI Eina_Bool