summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-03-24 21:00:26 +0900
committerHermet Park <chuneon.park@samsung.com>2020-03-24 21:00:26 +0900
commit6f95a42f602e5f0abb81dd42b7b7b3cfbdcf2336 (patch)
treeed1c5520fbe2087c7ebca98fed53ac96dea98ffa
parent912fbe79a2f3ee56f0e2c5e1fe5270cc12d64227 (diff)
elm_transit: replace evas_object_event_callback_xxx with efl_event_callback_xxx
Summary: In transit, event_callback is mainly used for delete callback. transit uses evas_object_freeze_events_set to control the user's mouse events. However, EVAS_CALLBACK_DEL was not called because of this. The behavior of evas_object_freeze_event was changed. This patch was created to fix some issues. Test Plan: N/A Reviewers: Hermet, kimcinoo, herb Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11562
-rw-r--r--src/lib/elementary/elm_transit.c109
1 files changed, 57 insertions, 52 deletions
diff --git a/src/lib/elementary/elm_transit.c b/src/lib/elementary/elm_transit.c
index 590c416535..14785eaa62 100644
--- a/src/lib/elementary/elm_transit.c
+++ b/src/lib/elementary/elm_transit.c
@@ -104,7 +104,7 @@ typedef struct _Elm_Transit_Obj_Data Elm_Transit_Obj_Data;
104 104
105static void _transit_obj_data_save(Evas_Object *obj); 105static void _transit_obj_data_save(Evas_Object *obj);
106static void _transit_obj_data_recover(Elm_Transit *transit, Evas_Object *obj); 106static void _transit_obj_data_recover(Elm_Transit *transit, Evas_Object *obj);
107static void _transit_obj_remove_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED); 107static void _transit_obj_remove_cb(void *data, const Efl_Event *ev);
108static void _transit_obj_remove(Elm_Transit *transit, Evas_Object *obj); 108static void _transit_obj_remove(Elm_Transit *transit, Evas_Object *obj);
109static void _transit_effect_del(Elm_Transit *transit, Elm_Transit_Effect_Module *effect_module); 109static void _transit_effect_del(Elm_Transit *transit, Elm_Transit_Effect_Module *effect_module);
110static void _transit_remove_dead_effects(Elm_Transit *transit); 110static void _transit_remove_dead_effects(Elm_Transit *transit);
@@ -161,15 +161,16 @@ _remove_obj_from_list(Elm_Transit *transit, Evas_Object *obj)
161 if (!eina_list_data_find_list(transit->objs, obj)) 161 if (!eina_list_data_find_list(transit->objs, obj))
162 break; 162 break;
163 transit->objs = eina_list_remove(transit->objs, obj); 163 transit->objs = eina_list_remove(transit->objs, obj);
164 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, 164 efl_event_callback_del(obj, EFL_EVENT_DEL,
165 _transit_obj_remove_cb, 165 _transit_obj_remove_cb,
166 transit); 166 transit);
167 } 167 }
168} 168}
169 169
170static void 170static void
171_transit_obj_remove_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 171_transit_obj_remove_cb(void *data, const Efl_Event *ev)
172{ 172{
173 Eo* obj = ev->object;
173 Elm_Transit *transit = data; 174 Elm_Transit *transit = data;
174 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key); 175 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key);
175 if (obj_data) 176 if (obj_data)
@@ -660,9 +661,9 @@ elm_transit_object_add(Elm_Transit *transit, Evas_Object *obj)
660 } 661 }
661 } 662 }
662 663
663 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, 664 efl_event_callback_add(obj, EFL_EVENT_DEL,
664 _transit_obj_remove_cb, 665 _transit_obj_remove_cb,
665 transit); 666 transit);
666 667
667 transit->objs = eina_list_append(transit->objs, obj); 668 transit->objs = eina_list_append(transit->objs, obj);
668} 669}
@@ -1124,8 +1125,9 @@ struct _Elm_Transit_Effect_Translation
1124}; 1125};
1125 1126
1126static void 1127static void
1127_translation_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 1128_translation_object_del_cb(void *data, const Efl_Event *ev)
1128{ 1129{
1130 Eo* obj = ev->object;
1129 Elm_Transit_Effect_Translation *translation = data; 1131 Elm_Transit_Effect_Translation *translation = data;
1130 Eina_List *elist; 1132 Eina_List *elist;
1131 Elm_Transit_Effect_Translation_Node *translation_node; 1133 Elm_Transit_Effect_Translation_Node *translation_node;
@@ -1160,8 +1162,8 @@ _translation_nodes_build(Elm_Transit *transit, Elm_Transit_Effect_Translation *t
1160 evas_object_geometry_get(obj, &(translation_node->x), 1162 evas_object_geometry_get(obj, &(translation_node->x),
1161 &(translation_node->y), NULL, NULL); 1163 &(translation_node->y), NULL, NULL);
1162 data_list = eina_list_append(data_list, translation_node); 1164 data_list = eina_list_append(data_list, translation_node);
1163 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, 1165 efl_event_callback_add(obj, EFL_EVENT_DEL,
1164 _translation_object_del_cb, translation); 1166 _translation_object_del_cb, translation);
1165 } 1167 }
1166 return data_list; 1168 return data_list;
1167} 1169}
@@ -1177,8 +1179,8 @@ _transit_effect_translation_context_free(Elm_Transit_Effect *effect, Elm_Transit
1177 EINA_LIST_FOREACH_SAFE(translation->nodes, 1179 EINA_LIST_FOREACH_SAFE(translation->nodes,
1178 elist, elist_next, translation_node) 1180 elist, elist_next, translation_node)
1179 { 1181 {
1180 evas_object_event_callback_del(translation_node->obj, 1182 efl_event_callback_del(translation_node->obj,
1181 EVAS_CALLBACK_DEL, _translation_object_del_cb); 1183 EFL_EVENT_DEL, _translation_object_del_cb, translation);
1182 translation->nodes = eina_list_remove_list(translation->nodes, elist); 1184 translation->nodes = eina_list_remove_list(translation->nodes, elist);
1183 free(translation_node); 1185 free(translation_node);
1184 } 1186 }
@@ -1512,8 +1514,9 @@ struct _Elm_Transit_Effect_Resizable_Flip
1512}; 1514};
1513 1515
1514static void 1516static void
1515_resizable_flip_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 1517_resizable_flip_object_del_cb(void *data, const Efl_Event *ev)
1516{ 1518{
1519 Eo* obj = ev->object;
1517 Elm_Transit_Effect_ResizableFlip *resizable_flip = data; 1520 Elm_Transit_Effect_ResizableFlip *resizable_flip = data;
1518 Eina_List *elist; 1521 Eina_List *elist;
1519 Elm_Transit_Effect_ResizableFlip_Node *resizable_flip_node; 1522 Elm_Transit_Effect_ResizableFlip_Node *resizable_flip_node;
@@ -1521,11 +1524,11 @@ _resizable_flip_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
1521 EINA_LIST_FOREACH(resizable_flip->nodes, elist, resizable_flip_node) 1524 EINA_LIST_FOREACH(resizable_flip->nodes, elist, resizable_flip_node)
1522 { 1525 {
1523 if (resizable_flip_node->front == obj) 1526 if (resizable_flip_node->front == obj)
1524 evas_object_event_callback_del(resizable_flip_node->back, 1527 efl_event_callback_del(resizable_flip_node->back,
1525 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb); 1528 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1526 else if (resizable_flip_node->back == obj) 1529 else if (resizable_flip_node->back == obj)
1527 evas_object_event_callback_del(resizable_flip_node->front, 1530 efl_event_callback_del(resizable_flip_node->front,
1528 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb); 1531 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1529 else continue; 1532 else continue;
1530 1533
1531 resizable_flip->nodes = eina_list_remove_list(resizable_flip->nodes, 1534 resizable_flip->nodes = eina_list_remove_list(resizable_flip->nodes,
@@ -1574,10 +1577,10 @@ _resizable_flip_nodes_build(Elm_Transit *transit, Elm_Transit_Effect_ResizableFl
1574 1577
1575 data_list = eina_list_append(data_list, resizable_flip_node); 1578 data_list = eina_list_append(data_list, resizable_flip_node);
1576 1579
1577 evas_object_event_callback_add(resizable_flip_node->back, 1580 efl_event_callback_add(resizable_flip_node->back,
1578 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip); 1581 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1579 evas_object_event_callback_add(resizable_flip_node->front, 1582 efl_event_callback_add(resizable_flip_node->front,
1580 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip); 1583 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1581 } 1584 }
1582 1585
1583 return data_list; 1586 return data_list;
@@ -1651,10 +1654,10 @@ _transit_effect_resizable_flip_context_free(Elm_Transit_Effect *effect, Elm_Tran
1651 resizable_flip->nodes = eina_list_remove_list(resizable_flip->nodes, 1654 resizable_flip->nodes = eina_list_remove_list(resizable_flip->nodes,
1652 elist); 1655 elist);
1653 1656
1654 evas_object_event_callback_del(resizable_flip_node->back, 1657 efl_event_callback_del(resizable_flip_node->back,
1655 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb); 1658 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1656 evas_object_event_callback_del(resizable_flip_node->front, 1659 efl_event_callback_del(resizable_flip_node->front,
1657 EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb); 1660 EFL_EVENT_DEL, _resizable_flip_object_del_cb, resizable_flip);
1658 free(resizable_flip_node); 1661 free(resizable_flip_node);
1659 } 1662 }
1660 free(resizable_flip); 1663 free(resizable_flip);
@@ -2124,8 +2127,9 @@ struct _Elm_Transit_Effect_Fade
2124}; 2127};
2125 2128
2126static void 2129static void
2127_fade_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 2130_fade_object_del_cb(void *data, const Efl_Event *ev)
2128{ 2131{
2132 Eo* obj = ev->object;
2129 Elm_Transit_Effect_Fade *fade = data; 2133 Elm_Transit_Effect_Fade *fade = data;
2130 Eina_List *elist; 2134 Eina_List *elist;
2131 Elm_Transit_Effect_Fade_Node *fade_node; 2135 Elm_Transit_Effect_Fade_Node *fade_node;
@@ -2133,11 +2137,11 @@ _fade_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *eve
2133 EINA_LIST_FOREACH(fade->nodes, elist, fade_node) 2137 EINA_LIST_FOREACH(fade->nodes, elist, fade_node)
2134 { 2138 {
2135 if (fade_node->before == obj) 2139 if (fade_node->before == obj)
2136 evas_object_event_callback_del(fade_node->after, 2140 efl_event_callback_del(fade_node->after,
2137 EVAS_CALLBACK_DEL, _fade_object_del_cb); 2141 EFL_EVENT_DEL, _fade_object_del_cb, fade);
2138 else if (fade_node->after == obj) 2142 else if (fade_node->after == obj)
2139 evas_object_event_callback_del(fade_node->before, 2143 efl_event_callback_del(fade_node->before,
2140 EVAS_CALLBACK_DEL, _fade_object_del_cb); 2144 EFL_EVENT_DEL, _fade_object_del_cb, fade);
2141 else continue; 2145 else continue;
2142 2146
2143 fade->nodes = eina_list_remove_list(fade->nodes, elist); 2147 fade->nodes = eina_list_remove_list(fade->nodes, elist);
@@ -2178,10 +2182,10 @@ _fade_nodes_build(Elm_Transit *transit, Elm_Transit_Effect_Fade *fade_data)
2178 2182
2179 data_list = eina_list_append(data_list, fade); 2183 data_list = eina_list_append(data_list, fade);
2180 2184
2181 evas_object_event_callback_add(fade->before, 2185 efl_event_callback_add(fade->before,
2182 EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data); 2186 EFL_EVENT_DEL, _fade_object_del_cb, fade_data);
2183 evas_object_event_callback_add(fade->after, 2187 efl_event_callback_add(fade->after,
2184 EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data); 2188 EFL_EVENT_DEL, _fade_object_del_cb, fade_data);
2185 } 2189 }
2186 return data_list; 2190 return data_list;
2187} 2191}
@@ -2206,10 +2210,10 @@ _transit_effect_fade_context_free(Elm_Transit_Effect *effect, Elm_Transit *trans
2206 fade_node->after_color.a); 2210 fade_node->after_color.a);
2207 2211
2208 fade->nodes = eina_list_remove_list(fade->nodes, elist); 2212 fade->nodes = eina_list_remove_list(fade->nodes, elist);
2209 evas_object_event_callback_del(fade_node->before, 2213 efl_event_callback_del(fade_node->before,
2210 EVAS_CALLBACK_DEL, _fade_object_del_cb); 2214 EFL_EVENT_DEL, _fade_object_del_cb, fade);
2211 evas_object_event_callback_del(fade_node->after, 2215 efl_event_callback_del(fade_node->after,
2212 EVAS_CALLBACK_DEL, _fade_object_del_cb); 2216 EFL_EVENT_DEL, _fade_object_del_cb, fade);
2213 free(fade_node); 2217 free(fade_node);
2214 } 2218 }
2215 2219
@@ -2315,8 +2319,9 @@ struct _Elm_Transit_Effect_Blend
2315}; 2319};
2316 2320
2317static void 2321static void
2318_blend_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 2322_blend_object_del_cb(void *data, const Efl_Event *ev)
2319{ 2323{
2324 Eo* obj = ev->object;
2320 Elm_Transit_Effect_Blend *blend = data; 2325 Elm_Transit_Effect_Blend *blend = data;
2321 Eina_List *elist; 2326 Eina_List *elist;
2322 Elm_Transit_Effect_Blend_Node *blend_node; 2327 Elm_Transit_Effect_Blend_Node *blend_node;
@@ -2324,11 +2329,11 @@ _blend_object_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *ev
2324 EINA_LIST_FOREACH(blend->nodes, elist, blend_node) 2329 EINA_LIST_FOREACH(blend->nodes, elist, blend_node)
2325 { 2330 {
2326 if (blend_node->after == obj) 2331 if (blend_node->after == obj)
2327 evas_object_event_callback_del(blend_node->before, 2332 efl_event_callback_del(blend_node->before,
2328 EVAS_CALLBACK_DEL, _blend_object_del_cb); 2333 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2329 else if (blend_node->before == obj) 2334 else if (blend_node->before == obj)
2330 evas_object_event_callback_del(blend_node->after, 2335 efl_event_callback_del(blend_node->after,
2331 EVAS_CALLBACK_DEL, _blend_object_del_cb); 2336 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2332 else continue; 2337 else continue;
2333 2338
2334 blend->nodes = eina_list_remove_list(blend->nodes, elist); 2339 blend->nodes = eina_list_remove_list(blend->nodes, elist);
@@ -2368,10 +2373,10 @@ _blend_nodes_build(Elm_Transit *transit, Elm_Transit_Effect_Blend *blend)
2368 2373
2369 data_list = eina_list_append(data_list, blend_node); 2374 data_list = eina_list_append(data_list, blend_node);
2370 2375
2371 evas_object_event_callback_add(blend_node->before, 2376 efl_event_callback_add(blend_node->before,
2372 EVAS_CALLBACK_DEL, _blend_object_del_cb, blend); 2377 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2373 evas_object_event_callback_add(blend_node->after, 2378 efl_event_callback_add(blend_node->after,
2374 EVAS_CALLBACK_DEL, _blend_object_del_cb, blend); 2379 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2375 } 2380 }
2376 return data_list; 2381 return data_list;
2377} 2382}
@@ -2400,10 +2405,10 @@ _transit_effect_blend_context_free(Elm_Transit_Effect *effect, Elm_Transit *tran
2400 2405
2401 blend->nodes = eina_list_remove_list(blend->nodes, elist); 2406 blend->nodes = eina_list_remove_list(blend->nodes, elist);
2402 2407
2403 evas_object_event_callback_del(blend_node->before, 2408 efl_event_callback_del(blend_node->before,
2404 EVAS_CALLBACK_DEL, _blend_object_del_cb); 2409 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2405 evas_object_event_callback_del(blend_node->after, 2410 efl_event_callback_del(blend_node->after,
2406 EVAS_CALLBACK_DEL, _blend_object_del_cb); 2411 EFL_EVENT_DEL, _blend_object_del_cb, blend);
2407 free(blend_node); 2412 free(blend_node);
2408 } 2413 }
2409 free(blend); 2414 free(blend);