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