summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_callbacks.c
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-07-16 15:18:16 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-07-16 15:18:16 +0900
commit166e89baacbe9fb4e29b580e97e9b67352f622df (patch)
tree235a244b3fde8d94e0397118c88e4c8596c600c1 /src/lib/evas/canvas/evas_callbacks.c
parentebb36c98a8421db983cc81b69c70549f65886f4a (diff)
Revert "eo: try to fix callback array to work on other system."
This reverts commit e89f32d28d746e07422d84ddd356e1227f100ef8.
Diffstat (limited to 'src/lib/evas/canvas/evas_callbacks.c')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c162
1 files changed, 78 insertions, 84 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index dc9cbce376..8dbdfe8cbe 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -7,84 +7,78 @@ EVAS_MEMPOOL(_mp_pc);
7 7
8extern Eina_Hash* signals_hash_table; 8extern Eina_Hash* signals_hash_table;
9 9
10static const Eo_Event_Description _EVAS_OBJECT_EVENTS[] = { 10EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_IN =
11 EO_EVENT_DESCRIPTION("Mouse In", "Mouse In Event"), 11 EO_EVENT_DESCRIPTION("Mouse In", "Mouse In Event");
12 EO_EVENT_DESCRIPTION("Mouse Out", "Mouse Out Event"), 12EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_OUT =
13 EO_EVENT_DESCRIPTION("Mouse Down", "Mouse Button Down Event"), 13 EO_EVENT_DESCRIPTION("Mouse Out", "Mouse Out Event");
14 EO_EVENT_DESCRIPTION("Mouse Up", "Mouse Button Up Event"), 14EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_DOWN =
15 EO_EVENT_DESCRIPTION("Mouse Move", "Mouse Move Event"), 15 EO_EVENT_DESCRIPTION("Mouse Down", "Mouse Button Down Event");
16 EO_EVENT_DESCRIPTION("Mouse Wheel", "Mouse Wheel Event"), 16EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_UP =
17 EO_EVENT_DESCRIPTION("Multi Down", "Mouse-touch Down Event"), 17 EO_EVENT_DESCRIPTION("Mouse Up", "Mouse Button Up Event");
18 EO_EVENT_DESCRIPTION("Multi Up", "Mouse-touch Up Event"), 18EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_MOVE =
19 EO_EVENT_DESCRIPTION("Multi Move", "Multi-touch Move Event"), 19 EO_EVENT_DESCRIPTION("Mouse Move", "Mouse Move Event");
20 EO_EVENT_DESCRIPTION("Free", "Object Being Freed (Called after Del)"), 20EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_WHEEL =
21 EO_EVENT_DESCRIPTION("Key Down", "Key Press Event"), 21 EO_EVENT_DESCRIPTION("Mouse Wheel", "Mouse Wheel Event");
22 EO_EVENT_DESCRIPTION("Key Up", "Key Release Event"), 22EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MULTI_DOWN =
23 EO_EVENT_DESCRIPTION("Focus In", "Focus In Event"), 23 EO_EVENT_DESCRIPTION("Multi Down", "Mouse-touch Down Event");
24 EO_EVENT_DESCRIPTION("Focus Out", "Focus Out Event"), 24EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MULTI_UP =
25 EO_EVENT_DESCRIPTION("Show", "Show Event"), 25 EO_EVENT_DESCRIPTION("Multi Up", "Mouse-touch Up Event");
26 EO_EVENT_DESCRIPTION("Hide", "Hide Event"), 26EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MULTI_MOVE =
27 EO_EVENT_DESCRIPTION("Move", "Move Event"), 27 EO_EVENT_DESCRIPTION("Multi Move", "Multi-touch Move Event");
28 EO_EVENT_DESCRIPTION("Resize", "Resize Event"), 28EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_FREE =
29 EO_EVENT_DESCRIPTION("Restack", "Restack Event"), 29 EO_EVENT_DESCRIPTION("Free", "Object Being Freed (Called after Del)");
30 EO_EVENT_DESCRIPTION("Del", "Object Being Deleted (called before Free)"), 30EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_KEY_DOWN =
31 EO_EVENT_DESCRIPTION("Hold", "Events go on/off hold"), 31 EO_EVENT_DESCRIPTION("Key Down", "Key Press Event");
32 EO_EVENT_DESCRIPTION("Changed Size Hints", "Size hints changed event"), 32EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_KEY_UP =
33 EO_EVENT_DESCRIPTION("Image Preloaded", "Image has been preloaded"), 33 EO_EVENT_DESCRIPTION("Key Up", "Key Release Event");
34 EO_EVENT_DESCRIPTION("Image Resize", "Image resize"), 34EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_FOCUS_IN =
35 EO_EVENT_DESCRIPTION("Image Unloaded", "Image data has been unloaded (by some mechanism in Evas that throw out original image data)"), 35 EO_EVENT_DESCRIPTION("Focus In", "Focus In Event");
36 EO_EVENT_DESCRIPTION("Render Pre", "Called just before rendering starts on the canvas target @since 1.2"), 36EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_FOCUS_OUT =
37 EO_EVENT_DESCRIPTION("Render Post", "Called just after rendering stops on the canvas target @since 1.2") 37 EO_EVENT_DESCRIPTION("Focus Out", "Focus Out Event");
38}; 38EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_SHOW =
39 39 EO_EVENT_DESCRIPTION("Show", "Show Event");
40EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_IN = &_EVAS_OBJECT_EVENTS[0]; 40EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_HIDE =
41EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_OUT = &_EVAS_OBJECT_EVENTS[1]; 41 EO_EVENT_DESCRIPTION("Hide", "Hide Event");
42EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_DOWN = &_EVAS_OBJECT_EVENTS[2]; 42EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_MOVE =
43EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_UP = &_EVAS_OBJECT_EVENTS[3]; 43 EO_EVENT_DESCRIPTION("Move", "Move Event");
44EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_MOVE = &_EVAS_OBJECT_EVENTS[4]; 44EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_RESIZE =
45EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOUSE_WHEEL = &_EVAS_OBJECT_EVENTS[5]; 45 EO_EVENT_DESCRIPTION("Resize", "Resize Event");
46EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MULTI_DOWN = &_EVAS_OBJECT_EVENTS[6]; 46EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_RESTACK =
47EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MULTI_UP = &_EVAS_OBJECT_EVENTS[7]; 47 EO_EVENT_DESCRIPTION("Restack", "Restack Event");
48EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MULTI_MOVE = &_EVAS_OBJECT_EVENTS[8]; 48EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_DEL =
49EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_FREE = &_EVAS_OBJECT_EVENTS[9]; 49 EO_EVENT_DESCRIPTION("Del", "Object Being Deleted (called before Free)");
50EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_KEY_DOWN = &_EVAS_OBJECT_EVENTS[10]; 50EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_HOLD =
51EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_KEY_UP = &_EVAS_OBJECT_EVENTS[11]; 51 EO_EVENT_DESCRIPTION("Hold", "Events go on/off hold");
52EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_FOCUS_IN = &_EVAS_OBJECT_EVENTS[12]; 52EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_CHANGED_SIZE_HINTS =
53EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_FOCUS_OUT = &_EVAS_OBJECT_EVENTS[13]; 53 EO_EVENT_DESCRIPTION("Changed Size Hints", "Size hints changed event");
54EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_SHOW = &_EVAS_OBJECT_EVENTS[14]; 54EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_IMAGE_PRELOADED =
55EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_HIDE = &_EVAS_OBJECT_EVENTS[15]; 55 EO_EVENT_DESCRIPTION("Image Preloaded", "Image has been preloaded");
56EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_MOVE = &_EVAS_OBJECT_EVENTS[16]; 56EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_IMAGE_RESIZE=
57EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_RESIZE = &_EVAS_OBJECT_EVENTS[17]; 57 EO_EVENT_DESCRIPTION("Image Resize", "Image resize");
58EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_RESTACK = &_EVAS_OBJECT_EVENTS[18]; 58EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_IMAGE_UNLOADED =
59EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_DEL = &_EVAS_OBJECT_EVENTS[19]; 59 EO_EVENT_DESCRIPTION("Image Unloaded", "Image data has been unloaded (by some mechanism in Evas that throw out original image data)");
60EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_HOLD = &_EVAS_OBJECT_EVENTS[20]; 60EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_RENDER_PRE =
61EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_CHANGED_SIZE_HINTS = &_EVAS_OBJECT_EVENTS[21]; 61 EO_EVENT_DESCRIPTION("Render Pre", "Called just before rendering starts on the canvas target @since 1.2");
62EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_IMAGE_PRELOADED = &_EVAS_OBJECT_EVENTS[22]; 62EAPI const Eo_Event_Description _EVAS_OBJECT_EVENT_RENDER_POST =
63EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_IMAGE_RESIZE= &_EVAS_OBJECT_EVENTS[23]; 63 EO_EVENT_DESCRIPTION("Render Post", "Called just after rendering stops on the canvas target @since 1.2");
64EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_IMAGE_UNLOADED = &_EVAS_OBJECT_EVENTS[24]; 64
65EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_RENDER_PRE = &_EVAS_OBJECT_EVENTS[25]; 65EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_IN =
66EAPI const Eo_Event_Description *_EVAS_OBJECT_EVENT_RENDER_POST = &_EVAS_OBJECT_EVENTS[26]; 66 EO_HOT_EVENT_DESCRIPTION("Canvas Focus In", "Canvas got focus as a whole");
67 67EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_OUT =
68EAPI const Eo_Event_Description _EVAS_CANVAS_EVENTS[] = { 68 EO_HOT_EVENT_DESCRIPTION("Canvas Focus Out", "Canvas lost focus as a whole");
69 EO_HOT_EVENT_DESCRIPTION("Canvas Focus In", "Canvas got focus as a whole"), 69EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE =
70 EO_HOT_EVENT_DESCRIPTION("Canvas Focus Out", "Canvas lost focus as a whole"), 70 EO_HOT_EVENT_DESCRIPTION("Render Flush Pre", "Called just before rendering is updated on the canvas target");
71 EO_HOT_EVENT_DESCRIPTION("Render Flush Pre", "Called just before rendering is updated on the canvas target"), 71EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_POST =
72 EO_HOT_EVENT_DESCRIPTION("Render Flush Post", "Called just after rendering is updated on the canvas target"), 72 EO_HOT_EVENT_DESCRIPTION("Render Flush Post", "Called just after rendering is updated on the canvas target");
73 EO_HOT_EVENT_DESCRIPTION("Canvas Object Focus In", "Canvas object got focus"), 73EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_IN =
74 EO_HOT_EVENT_DESCRIPTION("Canvas Object Focus Out", "Canvas object lost focus") 74 EO_HOT_EVENT_DESCRIPTION("Canvas Object Focus In", "Canvas object got focus");
75}; 75EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT =
76 76 EO_HOT_EVENT_DESCRIPTION("Canvas Object Focus Out", "Canvas object lost focus");
77EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_FOCUS_IN = &_EVAS_CANVAS_EVENTS[0];
78EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_FOCUS_OUT = &_EVAS_CANVAS_EVENTS[1];
79EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE = &_EVAS_CANVAS_EVENTS[2];
80EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_RENDER_FLUSH_POST = &_EVAS_CANVAS_EVENTS[3];
81EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_OBJECT_FOCUS_IN = &_EVAS_CANVAS_EVENTS[4];
82EAPI const Eo_Event_Description *_EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT = &_EVAS_CANVAS_EVENTS[5];
83 77
84/** 78/**
85 * Evas events descriptions for Eo. 79 * Evas events descriptions for Eo.
86 */ 80 */
87static const Eo_Event_Description **_legacy_evas_callback_table[EVAS_CALLBACK_LAST] = 81static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAST] =
88{ 82{
89 EVAS_OBJECT_EVENT_MOUSE_IN, 83 EVAS_OBJECT_EVENT_MOUSE_IN,
90 EVAS_OBJECT_EVENT_MOUSE_OUT, 84 EVAS_OBJECT_EVENT_MOUSE_OUT,
@@ -200,7 +194,7 @@ evas_object_event_callback_all_del(Evas_Object *eo_obj)
200 EINA_INLIST_FOREACH_SAFE(obj->callbacks, itr, info) 194 EINA_INLIST_FOREACH_SAFE(obj->callbacks, itr, info)
201 { 195 {
202 eo_do(eo_obj, eo_event_callback_del( 196 eo_do(eo_obj, eo_event_callback_del(
203 *_legacy_evas_callback_table[info->type], _eo_evas_object_cb, info)); 197 _legacy_evas_callback_table[info->type], _eo_evas_object_cb, info));
204 198
205 obj->callbacks = 199 obj->callbacks =
206 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info)); 200 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
@@ -227,7 +221,7 @@ evas_event_callback_all_del(Evas *eo_e)
227 EINA_INLIST_FOREACH_SAFE(e->callbacks, itr, info) 221 EINA_INLIST_FOREACH_SAFE(e->callbacks, itr, info)
228 { 222 {
229 eo_do(eo_e, eo_event_callback_del( 223 eo_do(eo_e, eo_event_callback_del(
230 *_legacy_evas_callback_table[info->type], _eo_evas_cb, info)); 224 _legacy_evas_callback_table[info->type], _eo_evas_cb, info));
231 225
232 e->callbacks = 226 e->callbacks =
233 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info)); 227 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
@@ -244,7 +238,7 @@ evas_event_callback_cleanup(Evas *eo_e)
244void 238void
245evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info) 239evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
246{ 240{
247 eo_do(eo_e, eo_event_callback_call(*_legacy_evas_callback_table[type], event_info, NULL)); 241 eo_do(eo_e, eo_event_callback_call(_legacy_evas_callback_table[type], event_info, NULL));
248} 242}
249 243
250void 244void
@@ -305,7 +299,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
305 break; 299 break;
306 } 300 }
307 301
308 eo_do(eo_obj, eo_event_callback_call(*_legacy_evas_callback_table[type], event_info, NULL)); 302 eo_do(eo_obj, eo_event_callback_call(_legacy_evas_callback_table[type], event_info, NULL));
309 303
310 if (type == EVAS_CALLBACK_MOUSE_DOWN) 304 if (type == EVAS_CALLBACK_MOUSE_DOWN)
311 { 305 {
@@ -354,7 +348,7 @@ evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type
354 cb_info->data = (void *)data; 348 cb_info->data = (void *)data;
355 cb_info->type = type; 349 cb_info->type = type;
356 350
357 const Eo_Event_Description *desc = *_legacy_evas_callback_table[type]; 351 const Eo_Event_Description *desc = _legacy_evas_callback_table[type];
358 eo_do(eo_obj, eo_event_callback_priority_add(desc, priority, _eo_evas_object_cb, cb_info)); 352 eo_do(eo_obj, eo_event_callback_priority_add(desc, priority, _eo_evas_object_cb, cb_info));
359 353
360 obj->callbacks = 354 obj->callbacks =
@@ -382,7 +376,7 @@ evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
382 { 376 {
383 void *tmp = info->data; 377 void *tmp = info->data;
384 eo_do(eo_obj, eo_event_callback_del( 378 eo_do(eo_obj, eo_event_callback_del(
385 *_legacy_evas_callback_table[type], _eo_evas_object_cb, info)); 379 _legacy_evas_callback_table[type], _eo_evas_object_cb, info));
386 380
387 obj->callbacks = 381 obj->callbacks =
388 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info)); 382 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
@@ -414,7 +408,7 @@ evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type
414 { 408 {
415 void *tmp = info->data; 409 void *tmp = info->data;
416 eo_do(eo_obj, eo_event_callback_del( 410 eo_do(eo_obj, eo_event_callback_del(
417 *_legacy_evas_callback_table[type], _eo_evas_object_cb, info)); 411 _legacy_evas_callback_table[type], _eo_evas_object_cb, info));
418 412
419 obj->callbacks = 413 obj->callbacks =
420 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info)); 414 eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
@@ -448,7 +442,7 @@ evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callb
448 cb_info->data = (void *)data; 442 cb_info->data = (void *)data;
449 cb_info->type = type; 443 cb_info->type = type;
450 444
451 const Eo_Event_Description *desc = *_legacy_evas_callback_table[type]; 445 const Eo_Event_Description *desc = _legacy_evas_callback_table[type];
452 eo_do(eo_e, eo_event_callback_priority_add(desc, priority, _eo_evas_cb, cb_info)); 446 eo_do(eo_e, eo_event_callback_priority_add(desc, priority, _eo_evas_cb, cb_info));
453 447
454 e->callbacks = eina_inlist_append(e->callbacks, EINA_INLIST_GET(cb_info)); 448 e->callbacks = eina_inlist_append(e->callbacks, EINA_INLIST_GET(cb_info));
@@ -475,7 +469,7 @@ evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
475 { 469 {
476 void *tmp = info->data; 470 void *tmp = info->data;
477 eo_do(eo_e, eo_event_callback_del( 471 eo_do(eo_e, eo_event_callback_del(
478 *_legacy_evas_callback_table[type], _eo_evas_cb, info)); 472 _legacy_evas_callback_table[type], _eo_evas_cb, info));
479 473
480 e->callbacks = 474 e->callbacks =
481 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info)); 475 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
@@ -507,7 +501,7 @@ evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb
507 { 501 {
508 void *tmp = info->data; 502 void *tmp = info->data;
509 eo_do(eo_e, eo_event_callback_del( 503 eo_do(eo_e, eo_event_callback_del(
510 *_legacy_evas_callback_table[type], _eo_evas_cb, info)); 504 _legacy_evas_callback_table[type], _eo_evas_cb, info));
511 505
512 e->callbacks = 506 e->callbacks =
513 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info)); 507 eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));