summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-04-26 14:49:26 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-06-07 11:00:52 +0300
commitf9c116a48749c642eb31154a4cfb5f60a110dcba (patch)
tree2cbf4d8891d6aa65c5f8867cb95549947208b864 /src/examples
parentb563efc52ffbc02ae33d4901326a583102975cbb (diff)
emotion: porting evas smart callbacks to eo
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/emotion/emotion_basic_example.c17
-rw-r--r--src/examples/emotion/emotion_border_example.c66
-rw-r--r--src/examples/emotion/emotion_generic_example.c80
-rw-r--r--src/examples/emotion/emotion_generic_subtitle_example.c16
-rw-r--r--src/examples/emotion/emotion_signals_example.c87
5 files changed, 179 insertions, 87 deletions
diff --git a/src/examples/emotion/emotion_basic_example.c b/src/examples/emotion/emotion_basic_example.c
index ec465bcbf3..ebf824428d 100644
--- a/src/examples/emotion/emotion_basic_example.c
+++ b/src/examples/emotion/emotion_basic_example.c
@@ -1,5 +1,9 @@
1//Compile with: 1//Compile with:
2// gcc -o emotion_basic_example emotion_basic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas` 2// gcc -o emotion_basic_example emotion_basic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
3
4#define EFL_BETA_API_SUPPORT
5#define EFL_EO_API_SUPPORT
6#include <Eo.h>
3 7
4#include <Ecore.h> 8#include <Ecore.h>
5#include <Ecore_Evas.h> 9#include <Ecore_Evas.h>
@@ -10,10 +14,13 @@
10#define WIDTH (320) 14#define WIDTH (320)
11#define HEIGHT (240) 15#define HEIGHT (240)
12 16
13static void 17static Eina_Bool
14_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 18_playback_started_cb(void *data EINA_UNUSED,
19 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
15{ 20{
16 printf("Emotion object started playback.\n"); 21 printf("Emotion object started playback.\n");
22
23 return EINA_TRUE;
17} 24}
18 25
19int 26int
@@ -58,8 +65,8 @@ main(int argc, const char *argv[])
58 em = emotion_object_add(e); 65 em = emotion_object_add(e);
59 emotion_object_init(em, NULL); 66 emotion_object_init(em, NULL);
60 67
61 evas_object_smart_callback_add( 68 eo_do(em, eo_event_callback_add
62 em, "playback_started", _playback_started_cb, NULL); 69 (EMOTION_OBJECT_EVENT_PLAYBACK_START, _playback_started_cb, NULL));
63 70
64 emotion_object_file_set(em, filename); 71 emotion_object_file_set(em, filename);
65 72
diff --git a/src/examples/emotion/emotion_border_example.c b/src/examples/emotion/emotion_border_example.c
index 695b50762b..22eca25cf1 100644
--- a/src/examples/emotion/emotion_border_example.c
+++ b/src/examples/emotion/emotion_border_example.c
@@ -1,5 +1,8 @@
1//Compile with: 1//Compile with:
2// gcc -o emotion_border_example emotion_border_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina` 2// gcc -o emotion_border_example emotion_border_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo`
3
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
3 6
4#include <Ecore.h> 7#include <Ecore.h>
5#include <Ecore_Evas.h> 8#include <Ecore_Evas.h>
@@ -14,10 +17,13 @@
14static Eina_List *filenames = NULL; 17static Eina_List *filenames = NULL;
15static Eina_List *curfile = NULL; 18static Eina_List *curfile = NULL;
16 19
17static void 20static Eina_Bool
18_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 21_playback_started_cb(void *data EINA_UNUSED,
22 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
19{ 23{
20 printf("Emotion object started playback.\n"); 24 printf("Emotion object started playback.\n");
25
26 return EINA_TRUE;
21} 27}
22 28
23static Evas_Object * 29static Evas_Object *
@@ -27,8 +33,8 @@ _create_emotion_object(Evas *e)
27 33
28 emotion_object_init(em, "gstreamer1"); 34 emotion_object_init(em, "gstreamer1");
29 35
30 evas_object_smart_callback_add( 36 eo_do(em, eo_event_callback_add(
31 em, "playback_started", _playback_started_cb, NULL); 37 EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
32 38
33 return em; 39 return em;
34} 40}
@@ -103,38 +109,53 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *
103 } 109 }
104} 110}
105 111
106static void 112static Eina_Bool
107_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 113_frame_decode_cb(void *data EINA_UNUSED,
114 Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
108{ 115{
109 // fprintf(stderr, "smartcb: frame_decode\n"); 116 // fprintf(stderr, "smartcb: frame_decode\n");
117
118 return EINA_TRUE;
110} 119}
111 120
112static void 121static Eina_Bool
113_length_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 122_length_change_cb(void *data EINA_UNUSED,
123 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
114{ 124{
115 fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o)); 125 fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o));
126
127 return EINA_TRUE;
116} 128}
117 129
118static void 130static Eina_Bool
119_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 131_position_update_cb(void *data EINA_UNUSED,
132 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
120{ 133{
121 fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o)); 134 fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o));
135
136 return EINA_TRUE;
122} 137}
123 138
124static void 139static Eina_Bool
125_progress_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 140_progress_change_cb(void *data EINA_UNUSED,
141 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
126{ 142{
127 fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n", 143 fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n",
128 emotion_object_progress_status_get(o), 144 emotion_object_progress_status_get(o),
129 emotion_object_progress_info_get(o)); 145 emotion_object_progress_info_get(o));
146
147 return EINA_TRUE;
130} 148}
131 149
132static void 150static Eina_Bool
133_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 151_frame_resize_cb(void *data EINA_UNUSED,
152 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
134{ 153{
135 int w, h; 154 int w, h;
136 emotion_object_size_get(o, &w, &h); 155 emotion_object_size_get(o, &w, &h);
137 fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h); 156 fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h);
157
158 return EINA_TRUE;
138} 159}
139 160
140static void /* adjust canvas' contents on resizes */ 161static void /* adjust canvas' contents on resizes */
@@ -153,6 +174,15 @@ _canvas_resize_cb(Ecore_Evas *ee)
153 evas_object_resize(em, w - 20, h - 20); 174 evas_object_resize(em, w - 20, h - 20);
154} 175}
155 176
177static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
178 { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
179 { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _length_change_cb },
180 { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
181 { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, _progress_change_cb },
182 { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resize_cb },
183 { NULL, NULL }
184};
185
156int 186int
157main(int argc, const char *argv[]) 187main(int argc, const char *argv[])
158{ 188{
@@ -211,11 +241,7 @@ main(int argc, const char *argv[])
211 241
212 ecore_evas_data_set(ee, "emotion", em); 242 ecore_evas_data_set(ee, "emotion", em);
213 243
214 evas_object_smart_callback_add(em, "frame_decode", _frame_decode_cb, NULL); 244 eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL));
215 evas_object_smart_callback_add(em, "length_change", _length_change_cb, NULL);
216 evas_object_smart_callback_add(em, "position_update", _position_update_cb, NULL);
217 evas_object_smart_callback_add(em, "progress_change", _progress_change_cb, NULL);
218 evas_object_smart_callback_add(em, "frame_resize", _frame_resize_cb, NULL);
219 245
220 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em); 246 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
221 evas_object_focus_set(bg, EINA_TRUE); 247 evas_object_focus_set(bg, EINA_TRUE);
diff --git a/src/examples/emotion/emotion_generic_example.c b/src/examples/emotion/emotion_generic_example.c
index 9320230c88..5bd869c380 100644
--- a/src/examples/emotion/emotion_generic_example.c
+++ b/src/examples/emotion/emotion_generic_example.c
@@ -1,5 +1,8 @@
1//Compile with: 1//Compile with:
2// gcc -o emotion_generic_example emotion_generic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina` 2// gcc -o emotion_generic_example emotion_generic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo`
3
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
3 6
4#include <Ecore.h> 7#include <Ecore.h>
5#include <Ecore_Evas.h> 8#include <Ecore_Evas.h>
@@ -15,18 +18,24 @@
15static Eina_List *filenames = NULL; 18static Eina_List *filenames = NULL;
16static Eina_List *curfile = NULL; 19static Eina_List *curfile = NULL;
17 20
18static void 21static Eina_Bool
19_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 22_playback_started_cb(void *data EINA_UNUSED,
23 Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
20{ 24{
21 printf("Emotion object started playback.\n"); 25 printf("Emotion object started playback.\n");
26
27 return EINA_TRUE;
22} 28}
23 29
24static void 30static Eina_Bool
25_playback_stopped_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 31_playback_stopped_cb(void *data EINA_UNUSED,
32 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
26{ 33{
27 printf("Emotion playback stopped.\n"); 34 printf("Emotion playback stopped.\n");
28 emotion_object_play_set(o, EINA_FALSE); 35 emotion_object_play_set(o, EINA_FALSE);
29 emotion_object_position_set(o, 0); 36 emotion_object_position_set(o, 0);
37
38 return EINA_TRUE;
30} 39}
31 40
32static Evas_Object * 41static Evas_Object *
@@ -36,10 +45,10 @@ _create_emotion_object(Evas *e)
36 45
37 emotion_object_init(em, "generic"); 46 emotion_object_init(em, "generic");
38 47
39 evas_object_smart_callback_add( 48 eo_do(em, eo_event_callback_add
40 em, "playback_started", _playback_started_cb, NULL); 49 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
41 evas_object_smart_callback_add( 50 eo_do(em, eo_event_callback_add
42 em, "playback_finished", _playback_stopped_cb, NULL); 51 (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_stopped_cb, NULL));
43 52
44 return em; 53 return em;
45} 54}
@@ -123,40 +132,63 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *
123 } 132 }
124} 133}
125 134
126static void 135static Eina_Bool
127_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 136_frame_decode_cb(void *data EINA_UNUSED,
137 Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
128{ 138{
129 // fprintf(stderr, "smartcb: frame_decode\n"); 139 // fprintf(stderr, "smartcb: frame_decode\n");
140
141 return EINA_TRUE;
130} 142}
131 143
132static void 144static Eina_Bool
133_length_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 145_length_change_cb(void *data EINA_UNUSED,
146 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
134{ 147{
135 fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o)); 148 fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o));
149
150 return EINA_TRUE;
136} 151}
137 152
138static void 153static Eina_Bool
139_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 154_position_update_cb(void *data EINA_UNUSED,
155 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
140{ 156{
141 fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o)); 157 fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o));
158
159 return EINA_TRUE;
142} 160}
143 161
144static void 162static Eina_Bool
145_progress_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 163_progress_change_cb(void *data EINA_UNUSED,
164 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
146{ 165{
147 fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n", 166 fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n",
148 emotion_object_progress_status_get(o), 167 emotion_object_progress_status_get(obj),
149 emotion_object_progress_info_get(o)); 168 emotion_object_progress_info_get(obj));
169
170 return EINA_TRUE;
150} 171}
151 172
152static void 173static Eina_Bool
153_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 174_frame_resize_cb(void *data EINA_UNUSED,
175 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
154{ 176{
155 int w, h; 177 int w, h;
156 emotion_object_size_get(o, &w, &h); 178 emotion_object_size_get(o, &w, &h);
157 fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h); 179 fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h);
180
181 return EINA_TRUE;
158} 182}
159 183
184static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
185 { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
186 { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _length_change_cb },
187 { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
188 { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, _progress_change_cb },
189 { NULL, NULL }
190};
191
160int 192int
161main(int argc, const char *argv[]) 193main(int argc, const char *argv[])
162{ 194{
@@ -206,11 +238,7 @@ main(int argc, const char *argv[])
206 evas_object_resize(em, WIDTH, HEIGHT); 238 evas_object_resize(em, WIDTH, HEIGHT);
207 evas_object_show(em); 239 evas_object_show(em);
208 240
209 evas_object_smart_callback_add(em, "frame_decode", _frame_decode_cb, NULL); 241 eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL));
210 evas_object_smart_callback_add(em, "length_change", _length_change_cb, NULL);
211 evas_object_smart_callback_add(em, "position_update", _position_update_cb, NULL);
212 evas_object_smart_callback_add(em, "progress_change", _progress_change_cb, NULL);
213 evas_object_smart_callback_add(em, "frame_resize", _frame_resize_cb, NULL);
214 242
215 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em); 243 evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
216 evas_object_focus_set(bg, EINA_TRUE); 244 evas_object_focus_set(bg, EINA_TRUE);
diff --git a/src/examples/emotion/emotion_generic_subtitle_example.c b/src/examples/emotion/emotion_generic_subtitle_example.c
index b5fb5a880c..03b8aab8c6 100644
--- a/src/examples/emotion/emotion_generic_subtitle_example.c
+++ b/src/examples/emotion/emotion_generic_subtitle_example.c
@@ -1,5 +1,8 @@
1//Compile with: 1//Compile with:
2// gcc -o emotion_generic_subtitle_example emotion_generic_subtitle_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas` 2// gcc -o emotion_generic_subtitle_example emotion_generic_subtitle_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
3
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
3 6
4#include <Ecore.h> 7#include <Ecore.h>
5#include <Ecore_Evas.h> 8#include <Ecore_Evas.h>
@@ -10,10 +13,13 @@
10#define WIDTH (320) 13#define WIDTH (320)
11#define HEIGHT (240) 14#define HEIGHT (240)
12 15
13static void 16static Eina_Bool
14_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 17_playback_started_cb(void *data EINA_UNUSED,
18 Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
15{ 19{
16 printf("Emotion object started playback.\n"); 20 printf("Emotion object started playback.\n");
21
22 return EINA_TRUE;
17} 23}
18 24
19static void 25static void
@@ -74,8 +80,8 @@ main(int argc, const char *argv[])
74 if (subtitle_filename) 80 if (subtitle_filename)
75 emotion_object_video_subtitle_file_set(em, subtitle_filename); 81 emotion_object_video_subtitle_file_set(em, subtitle_filename);
76 82
77 evas_object_smart_callback_add( 83 eo_do(em, eo_event_callback_add
78 em, "playback_started", _playback_started_cb, NULL); 84 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
79 85
80 emotion_object_file_set(em, filename); 86 emotion_object_file_set(em, filename);
81 87
diff --git a/src/examples/emotion/emotion_signals_example.c b/src/examples/emotion/emotion_signals_example.c
index dd83ac2eb3..3c56c40924 100644
--- a/src/examples/emotion/emotion_signals_example.c
+++ b/src/examples/emotion/emotion_signals_example.c
@@ -1,5 +1,8 @@
1//Compile with: 1//Compile with:
2// gcc -o emotion_signals_example emotion_signals_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas` 2// gcc -o emotion_signals_example emotion_signals_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
3
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
3 6
4#include <Ecore.h> 7#include <Ecore.h>
5#include <Ecore_Evas.h> 8#include <Ecore_Evas.h>
@@ -30,74 +33,96 @@ _display_info(Evas_Object *o)
30 printf("\n"); 33 printf("\n");
31} 34}
32 35
33static void 36static Eina_Bool
34_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 37_playback_started_cb(void *data EINA_UNUSED,
38 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
35{ 39{
36 printf(">>> Emotion object started playback.\n"); 40 printf(">>> Emotion object started playback.\n");
37 _display_info(o); 41 _display_info(o);
42
43 return EINA_TRUE;
38} 44}
39 45
40static void 46static Eina_Bool
41_playback_finished_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 47_playback_finished_cb(void *data EINA_UNUSED,
48 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
42{ 49{
43 printf(">>> Emotion object finished playback.\n"); 50 printf(">>> Emotion object finished playback.\n");
44 _display_info(o); 51 _display_info(o);
52
53 return EINA_TRUE;
45} 54}
46 55
47static void 56static Eina_Bool
48_open_done_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 57_open_done_cb(void *data EINA_UNUSED,
58 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
49{ 59{
50 printf(">>> Emotion object open done.\n"); 60 printf(">>> Emotion object open done.\n");
51 _display_info(o); 61 _display_info(o);
62
63 return EINA_TRUE;
52} 64}
53 65
54static void 66static Eina_Bool
55_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 67_position_update_cb(void *data EINA_UNUSED,
68 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
56{ 69{
57 printf(">>> Emotion object first position update.\n"); 70 printf(">>> Emotion object first position update.\n");
58 evas_object_smart_callback_del(o, "position_update", _position_update_cb); 71 eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_POSITION_UPDATE,
72 _position_update_cb, NULL));
59 _display_info(o); 73 _display_info(o);
74
75 return EINA_TRUE;
60} 76}
61 77
62static void 78static Eina_Bool
63_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 79_frame_decode_cb(void *data EINA_UNUSED,
80 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
64{ 81{
65 printf(">>> Emotion object first frame decode.\n"); 82 printf(">>> Emotion object first frame decode.\n");
66 evas_object_smart_callback_del(o, "frame_decode", _frame_decode_cb); 83 eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_FRAME_DECODE,
84 _frame_decode_cb, NULL));
67 _display_info(o); 85 _display_info(o);
86
87 return EINA_TRUE;
68} 88}
69 89
70static void 90static Eina_Bool
71_decode_stop_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 91_decode_stop_cb(void *data EINA_UNUSED,
92 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
72{ 93{
73 printf(">>> Emotion object decode stop.\n"); 94 printf(">>> Emotion object decode stop.\n");
74 _display_info(o); 95 _display_info(o);
96
97 return EINA_TRUE;
75} 98}
76 99
77static void 100static Eina_Bool
78_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED) 101_frame_resize_cb(void *data EINA_UNUSED,
102 Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
79{ 103{
80 printf(">>> Emotion object frame resize.\n"); 104 printf(">>> Emotion object frame resize.\n");
81 _display_info(o); 105 _display_info(o);
106
107 return EINA_TRUE;
82} 108}
83 109
110static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
111 { EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb },
112 { EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_finished_cb },
113 { EMOTION_OBJECT_EVENT_OPEN_DONE, _open_done_cb },
114 { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
115 { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
116 { EMOTION_OBJECT_EVENT_DECODE_STOP, _decode_stop_cb },
117 { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resize_cb },
118 { NULL, NULL }
119};
120
84static void 121static void
85_setup_emotion_callbacks(Evas_Object *o) 122_setup_emotion_callbacks(Evas_Object *o)
86{ 123{
87 evas_object_smart_callback_add( 124 eo_do(o, eo_event_callback_add
88 o, "playback_started", _playback_started_cb, NULL); 125 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
89 evas_object_smart_callback_add(
90 o, "playback_finished", _playback_finished_cb, NULL);
91 evas_object_smart_callback_add(
92 o, "open_done", _open_done_cb, NULL);
93 evas_object_smart_callback_add(
94 o, "position_update", _position_update_cb, NULL);
95 evas_object_smart_callback_add(
96 o, "frame_decode", _frame_decode_cb, NULL);
97 evas_object_smart_callback_add(
98 o, "decode_stop", _decode_stop_cb, NULL);
99 evas_object_smart_callback_add(
100 o, "frame_resize", _frame_resize_cb, NULL);
101} 126}
102 127
103int 128int