summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_callbacks.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2013-04-11 22:08:24 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2013-05-05 14:32:24 +0300
commit3d5136e4cc02d43ec45acd5b6e1bf674500e21ae (patch)
tree4fecdc7e4a7ece3267b58b6153b9e088d38a6d0f /src/lib/evas/canvas/evas_callbacks.c
parent019a8b8298f29623757bd98db797980c3be4b090 (diff)
Efl: adapt legacy Evas callbacks to Eo callbacks mechanism.
Diffstat (limited to 'src/lib/evas/canvas/evas_callbacks.c')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c354
1 files changed, 119 insertions, 235 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index 34bceae0fd..b482913b3e 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -1,12 +1,8 @@
1#include "evas_common.h" 1#include "evas_common.h"
2#include "evas_private.h" 2#include "evas_private.h"
3 3
4static void evas_object_event_callback_clear(Evas_Object_Protected_Data *obj);
5static void evas_event_callback_clear(Evas_Public_Data *e);
6int _evas_event_counter = 0; 4int _evas_event_counter = 0;
7 5
8EVAS_MEMPOOL(_mp_fn);
9EVAS_MEMPOOL(_mp_cb);
10EVAS_MEMPOOL(_mp_pc); 6EVAS_MEMPOOL(_mp_pc);
11 7
12extern Eina_Hash* signals_hash_table; 8extern Eina_Hash* signals_hash_table;
@@ -117,7 +113,39 @@ static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAS
117 EVAS_EVENT_RENDER_PRE, 113 EVAS_EVENT_RENDER_PRE,
118 EVAS_EVENT_RENDER_POST 114 EVAS_EVENT_RENDER_POST
119}; 115};
120 116
117typedef struct
118{
119 EINA_INLIST;
120 Evas_Object_Event_Cb func;
121 void *data;
122 Evas_Callback_Type type;
123} _eo_evas_object_cb_info;
124
125static Eina_Bool
126_eo_evas_object_cb(void *data, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
127{
128 _eo_evas_object_cb_info *info = data;
129 if (info->func) info->func(info->data, evas_object_evas_get(eo_obj), eo_obj, event_info);
130 return EINA_TRUE;
131}
132
133typedef struct
134{
135 EINA_INLIST;
136 Evas_Event_Cb func;
137 void *data;
138 Evas_Callback_Type type;
139} _eo_evas_cb_info;
140
141static Eina_Bool
142_eo_evas_cb(void *data, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
143{
144 _eo_evas_cb_info *info = data;
145 if (info->func) info->func(info->data, eo_obj, event_info);
146 return EINA_TRUE;
147}
148
121void 149void
122_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e) 150_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e)
123{ 151{
@@ -150,143 +178,68 @@ _evas_post_event_callback_free(Evas *eo_e)
150} 178}
151 179
152void 180void
153evas_event_callback_list_post_free(Eina_Inlist **list) 181evas_object_event_callback_all_del(Evas_Object *eo_obj)
154{ 182{
155 Eina_Inlist *l; 183 _eo_evas_object_cb_info *info;
156 184 Eina_Inlist *itr;
157 /* MEM OK */ 185 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
158 for (l = *list; l;)
159 {
160 Evas_Func_Node *fn;
161
162 fn = (Evas_Func_Node *)l;
163 l = l->next;
164 if (fn->delete_me)
165 {
166 *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn));
167 EVAS_MEMPOOL_FREE(_mp_fn, fn);
168 }
169 }
170}
171 186
172static void
173evas_object_event_callback_clear(Evas_Object_Protected_Data *obj)
174{
175 if (!obj) return; 187 if (!obj) return;
176 if (!obj->callbacks) return; 188 if (!obj->callbacks) return;
177 if (!obj->callbacks->deletions_waiting) return; 189 EINA_INLIST_FOREACH_SAFE(obj->callbacks, itr, info)
178 obj->callbacks->deletions_waiting = 0;
179 evas_event_callback_list_post_free(&obj->callbacks->callbacks);
180 if (!obj->callbacks->callbacks)
181 { 190 {
182 EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks); 191 eo_do(eo_obj, eo_event_callback_del(
183 obj->callbacks = NULL; 192 _legacy_evas_callback_table[info->type], _eo_evas_object_cb, info));
184 }
185}
186 193
187static void 194 obj->callbacks =
188evas_event_callback_clear(Evas_Public_Data *e) 195 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
189{ 196 free(info);
190 if (!e) return;
191 if (!e->callbacks) return;
192 if (!e->callbacks->deletions_waiting) return;
193 e->callbacks->deletions_waiting = 0;
194 evas_event_callback_list_post_free(&e->callbacks->callbacks);
195 if (!e->callbacks->callbacks)
196 {
197 EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
198 e->callbacks = NULL;
199 } 197 }
200} 198}
201 199
202void 200void
203evas_object_event_callback_all_del(Evas_Object *eo_obj)
204{
205 Evas_Func_Node *fn;
206 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
207
208 if (!obj) return;
209 if (!obj->callbacks) return;
210 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
211 fn->delete_me = 1;
212}
213
214void
215evas_object_event_callback_cleanup(Evas_Object *eo_obj) 201evas_object_event_callback_cleanup(Evas_Object *eo_obj)
216{ 202{
217 /* MEM OK */ 203 evas_object_event_callback_all_del(eo_obj);
218 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
219 if (!obj) return;
220 if (!obj->callbacks) return;
221 evas_event_callback_list_post_free(&obj->callbacks->callbacks);
222 EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks);
223 obj->callbacks = NULL;
224} 204}
225 205
226void 206void
227evas_event_callback_all_del(Evas *eo_e) 207evas_event_callback_all_del(Evas *eo_e)
228{ 208{
209 _eo_evas_object_cb_info *info;
210 Eina_Inlist *itr;
229 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 211 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
230 Evas_Func_Node *fn;
231 212
232 if (!e) return; 213 if (!e) return;
233 if (!e->callbacks) return; 214 if (!e->callbacks) return;
234 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) 215
235 fn->delete_me = 1; 216 EINA_INLIST_FOREACH_SAFE(e->callbacks, itr, info)
217 {
218 eo_do(eo_e, eo_event_callback_del(
219 _legacy_evas_callback_table[info->type], _eo_evas_cb, info));
220
221 e->callbacks =
222 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
223 free(info);
224 }
236} 225}
237 226
238void 227void
239evas_event_callback_cleanup(Evas *eo_e) 228evas_event_callback_cleanup(Evas *eo_e)
240{ 229{
241 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 230 evas_event_callback_all_del(eo_e);
242 /* MEM OK */
243 if (!e) return;
244 if (!e->callbacks) return;
245 evas_event_callback_list_post_free(&e->callbacks->callbacks);
246 EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
247 e->callbacks = NULL;
248} 231}
249 232
250void 233void
251evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info) 234evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
252{ 235{
253 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 236 eo_do(eo_e, eo_event_callback_call(_legacy_evas_callback_table[type], event_info, NULL));
254 Eina_Inlist **l_mod = NULL, *l;
255
256 if (!e) return;
257 _evas_walk(e);
258 if (e->callbacks)
259 {
260 l_mod = &e->callbacks->callbacks;
261 e->callbacks->walking_list++;
262 for (l = *l_mod; l; l = l->next)
263 {
264 Evas_Func_Node *fn;
265
266 fn = (Evas_Func_Node *)l;
267 if ((fn->type == type) && (!fn->delete_me))
268 {
269 Evas_Event_Cb func = fn->func;
270 if (func)
271 func(fn->data, eo_e, event_info);
272 }
273 if (e->delete_me) break;
274 }
275 e->callbacks->walking_list--;
276 if (!e->callbacks->walking_list)
277 {
278 evas_event_callback_clear(e);
279 l_mod = NULL;
280 }
281 }
282 _evas_unwalk(e);
283} 237}
284 238
285void 239void
286evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Callback_Type type, void *event_info, int event_id) 240evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Callback_Type type, void *event_info, int event_id)
287{ 241{
288 /* MEM OK */ 242 /* MEM OK */
289 Eina_Inlist **l_mod = NULL, *l;
290 Evas_Button_Flags flags = EVAS_BUTTON_NONE; 243 Evas_Button_Flags flags = EVAS_BUTTON_NONE;
291 Evas_Public_Data *e; 244 Evas_Public_Data *e;
292 245
@@ -308,9 +261,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
308 if (!(e = obj->layer->evas)) return; 261 if (!(e = obj->layer->evas)) return;
309 262
310 _evas_walk(e); 263 _evas_walk(e);
311 if (obj->callbacks)
312 { 264 {
313 l_mod = &obj->callbacks->callbacks;
314 switch (type) 265 switch (type)
315 { 266 {
316 case EVAS_CALLBACK_MOUSE_DOWN: 267 case EVAS_CALLBACK_MOUSE_DOWN:
@@ -342,30 +293,8 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
342 default: 293 default:
343 break; 294 break;
344 } 295 }
345 obj->callbacks->walking_list++;
346 for (l = *l_mod; l; l = l->next)
347 {
348 Evas_Func_Node *fn;
349
350 fn = (Evas_Func_Node *)l;
351 if ((fn->type == type) && (!fn->delete_me))
352 {
353 Evas_Object_Event_Cb func = fn->func;
354 if (func)
355 func(fn->data, obj->layer->evas->evas, eo_obj, event_info);
356 }
357 if (obj->delete_me) break;
358 }
359 obj->callbacks->walking_list--;
360 if (!obj->callbacks->walking_list)
361 {
362 evas_object_event_callback_clear(obj);
363 l_mod = NULL;
364 }
365 296
366 const Eo_Event_Description *event_desc = eina_hash_find(signals_hash_table, _legacy_evas_callback_table[type]->name); 297 eo_do(eo_obj, eo_event_callback_call(_legacy_evas_callback_table[type], event_info, NULL));
367 if (event_desc)
368 eo_do(eo_obj, eo_event_callback_call(_legacy_evas_callback_table[type], event_info, NULL));
369 298
370 if (type == EVAS_CALLBACK_MOUSE_DOWN) 299 if (type == EVAS_CALLBACK_MOUSE_DOWN)
371 { 300 {
@@ -379,33 +308,18 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
379 } 308 }
380 } 309 }
381 310
382 if (!((obj->no_propagate) && (l_mod) && (*l_mod))) 311 if (!obj->no_propagate)
383 { 312 {
384 if (!obj->no_propagate) 313 if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
314 (type <= EVAS_CALLBACK_KEY_UP))
385 { 315 {
386 if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) && 316 Evas_Object_Protected_Data *smart_parent = eo_data_scope_get(obj->smart.parent, EVAS_OBJ_CLASS);
387 (type <= EVAS_CALLBACK_KEY_UP)) 317 evas_object_event_callback_call(obj->smart.parent, smart_parent, type, event_info, event_id);
388 {
389 Evas_Object_Protected_Data *smart_parent = eo_data_scope_get(obj->smart.parent, EVAS_OBJ_CLASS);
390 evas_object_event_callback_call(obj->smart.parent, smart_parent, type, event_info, event_id);
391 }
392 } 318 }
393 } 319 }
394 _evas_unwalk(e); 320 _evas_unwalk(e);
395} 321}
396 322
397static int
398_callback_priority_cmp(const void *_a, const void *_b)
399{
400 const Evas_Func_Node *a, *b;
401 a = EINA_INLIST_CONTAINER_GET(_a, Evas_Func_Node);
402 b = EINA_INLIST_CONTAINER_GET(_b, Evas_Func_Node);
403 if (a->priority < b->priority)
404 return -1;
405 else
406 return 1;
407}
408
409EAPI void 323EAPI void
410evas_object_event_callback_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) 324evas_object_event_callback_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
411{ 325{
@@ -417,43 +331,29 @@ EAPI void
417evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) 331evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data)
418{ 332{
419 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); 333 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
420 /* MEM OK */
421 Evas_Func_Node *fn;
422 334
423 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 335 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
424 return; 336 return;
425 MAGIC_CHECK_END(); 337 MAGIC_CHECK_END();
426 338
427 if (!obj) return;
428 if (!func) return; 339 if (!func) return;
429 340
430 if (!obj->callbacks) 341 _eo_evas_object_cb_info *cb_info = calloc(1, sizeof(*cb_info));
431 { 342 cb_info->func = func;
432 EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 64, ); 343 cb_info->data = (void *)data;
433 obj->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); 344 cb_info->type = type;
434 if (!obj->callbacks) return;
435 EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks);
436 }
437 345
438 EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 128, ); 346 const Eo_Event_Description *desc = _legacy_evas_callback_table[type];
439 fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); 347 eo_do(eo_obj, eo_event_callback_priority_add(desc, priority, _eo_evas_object_cb, cb_info));
440 if (!fn) return; 348
441 EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); 349 obj->callbacks =
442 fn->func = func; 350 eina_inlist_append(obj->callbacks, EINA_INLIST_GET(cb_info));
443 fn->data = (void *)data;
444 fn->type = type;
445 fn->priority = priority;
446
447 obj->callbacks->callbacks =
448 eina_inlist_sorted_insert(obj->callbacks->callbacks, EINA_INLIST_GET(fn),
449 _callback_priority_cmp);
450} 351}
451 352
452EAPI void * 353EAPI void *
453evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) 354evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
454{ 355{
455 /* MEM OK */ 356 _eo_evas_object_cb_info *info;
456 Evas_Func_Node *fn;
457 357
458 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 358 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
459 return NULL; 359 return NULL;
@@ -465,17 +365,17 @@ evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
465 365
466 if (!obj->callbacks) return NULL; 366 if (!obj->callbacks) return NULL;
467 367
468 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) 368 EINA_INLIST_FOREACH(obj->callbacks, info)
469 { 369 {
470 if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) 370 if ((info->func == func) && (info->type == type))
471 { 371 {
472 void *tmp; 372 void *tmp = info->data;
373 eo_do(eo_obj, eo_event_callback_del(
374 _legacy_evas_callback_table[type], _eo_evas_object_cb, info));
473 375
474 tmp = fn->data; 376 obj->callbacks =
475 fn->delete_me = 1; 377 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
476 obj->callbacks->deletions_waiting = 1; 378 free(info);
477 if (!obj->callbacks->walking_list)
478 evas_object_event_callback_clear(obj);
479 return tmp; 379 return tmp;
480 } 380 }
481 } 381 }
@@ -485,8 +385,7 @@ evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
485EAPI void * 385EAPI void *
486evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) 386evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
487{ 387{
488 /* MEM OK */ 388 _eo_evas_object_cb_info *info;
489 Evas_Func_Node *fn;
490 389
491 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 390 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
492 return NULL; 391 return NULL;
@@ -498,17 +397,17 @@ evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type
498 397
499 if (!obj->callbacks) return NULL; 398 if (!obj->callbacks) return NULL;
500 399
501 EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) 400 EINA_INLIST_FOREACH(obj->callbacks, info)
502 { 401 {
503 if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) 402 if ((info->func == func) && (info->type == type) && info->data == data)
504 { 403 {
505 void *tmp; 404 void *tmp = info->data;
405 eo_do(eo_obj, eo_event_callback_del(
406 _legacy_evas_callback_table[type], _eo_evas_object_cb, info));
506 407
507 tmp = fn->data; 408 obj->callbacks =
508 fn->delete_me = 1; 409 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
509 obj->callbacks->deletions_waiting = 1; 410 free(info);
510 if (!obj->callbacks->walking_list)
511 evas_object_event_callback_clear(obj);
512 return tmp; 411 return tmp;
513 } 412 }
514 } 413 }
@@ -526,43 +425,29 @@ EAPI void
526evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) 425evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data)
527{ 426{
528 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 427 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
529 /* MEM OK */
530 Evas_Func_Node *fn;
531 428
532 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 429 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
533 return; 430 return;
534 MAGIC_CHECK_END(); 431 MAGIC_CHECK_END();
535 432
536 if (!e) return;
537 if (!func) return; 433 if (!func) return;
538 434
539 if (!e->callbacks) 435 _eo_evas_cb_info *cb_info = calloc(1, sizeof(*cb_info));
540 { 436 cb_info->func = func;
541 EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 64, ); 437 cb_info->data = (void *)data;
542 e->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); 438 cb_info->type = type;
543 if (!e->callbacks) return;
544 EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks);
545 }
546 439
547 EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 128, ); 440 const Eo_Event_Description *desc = _legacy_evas_callback_table[type];
548 fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); 441 eo_do(eo_e, eo_event_callback_priority_add(desc, priority, _eo_evas_cb, cb_info));
549 if (!fn) return; 442
550 EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); 443 e->callbacks = eina_inlist_append(e->callbacks, EINA_INLIST_GET(cb_info));
551 fn->func = func;
552 fn->data = (void *)data;
553 fn->type = type;
554 fn->priority = priority;
555
556 e->callbacks->callbacks = eina_inlist_sorted_insert(e->callbacks->callbacks,
557 EINA_INLIST_GET(fn), _callback_priority_cmp);
558} 444}
559 445
560EAPI void * 446EAPI void *
561evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func) 447evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
562{ 448{
563 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); 449 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
564 /* MEM OK */ 450 _eo_evas_cb_info *info;
565 Evas_Func_Node *fn;
566 451
567 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 452 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
568 return NULL; 453 return NULL;
@@ -573,18 +458,18 @@ evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
573 458
574 if (!e->callbacks) return NULL; 459 if (!e->callbacks) return NULL;
575 460
576 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) 461 EINA_INLIST_FOREACH(e->callbacks, info)
577 { 462 {
578 if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) 463 if ((info->func == func) && (info->type == type))
579 { 464 {
580 void *data; 465 void *tmp = info->data;
581 466 eo_do(eo_e, eo_event_callback_del(
582 data = fn->data; 467 _legacy_evas_callback_table[type], _eo_evas_cb, info));
583 fn->delete_me = 1; 468
584 e->callbacks->deletions_waiting = 1; 469 e->callbacks =
585 if (!e->callbacks->walking_list) 470 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
586 evas_event_callback_clear(e); 471 free(info);
587 return data; 472 return tmp;
588 } 473 }
589 } 474 }
590 return NULL; 475 return NULL;
@@ -593,8 +478,7 @@ evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
593EAPI void * 478EAPI void *
594evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) 479evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
595{ 480{
596 /* MEM OK */ 481 _eo_evas_cb_info *info;
597 Evas_Func_Node *fn;
598 482
599 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 483 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
600 return NULL; 484 return NULL;
@@ -606,17 +490,17 @@ evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb
606 490
607 if (!e->callbacks) return NULL; 491 if (!e->callbacks) return NULL;
608 492
609 EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) 493 EINA_INLIST_FOREACH(e->callbacks, info)
610 { 494 {
611 if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) 495 if ((info->func == func) && (info->type == type) && (info->data == data))
612 { 496 {
613 void *tmp; 497 void *tmp = info->data;
498 eo_do(eo_e, eo_event_callback_del(
499 _legacy_evas_callback_table[type], _eo_evas_cb, info));
614 500
615 tmp = fn->data; 501 e->callbacks =
616 fn->delete_me = 1; 502 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
617 e->callbacks->deletions_waiting = 1; 503 free(info);
618 if (!e->callbacks->walking_list)
619 evas_event_callback_clear(e);
620 return tmp; 504 return tmp;
621 } 505 }
622 } 506 }