summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-18 14:44:09 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:33 +0300
commitef2ea27669838868ba3e2da2506397e7ad590f3c (patch)
tree10ff85b2af68617091b4eda47ffe06d5e21e507c
parent3091bf3455e97354c77a3f167cc19236a3e16347 (diff)
elm_video: porting evas smart callbacks to eodevs/avilog/replace_smart_callbacks_with_eo_elm
-rw-r--r--src/lib/elm_video.c84
1 files changed, 48 insertions, 36 deletions
diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c
index 09bb4ce8a..0afdbd471 100644
--- a/src/lib/elm_video.c
+++ b/src/lib/elm_video.c
@@ -134,44 +134,52 @@ _on_size_hints_changed(void *data EINA_UNUSED,
134 elm_layout_sizing_eval(obj); 134 elm_layout_sizing_eval(obj);
135} 135}
136 136
137static void 137static Eina_Bool
138_on_open_done(void *data, 138_on_open_done(void *data EINA_UNUSED,
139 Evas_Object *obj EINA_UNUSED, 139 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
140 void *event_info EINA_UNUSED) 140 void *event_info EINA_UNUSED)
141{ 141{
142 elm_layout_signal_emit(data, "elm,video,open", "elm"); 142 elm_layout_signal_emit(data, "elm,video,open", "elm");
143
144 return EINA_TRUE;
143} 145}
144 146
145static void 147static Eina_Bool
146_on_playback_started(void *data, 148_on_playback_started(void *data EINA_UNUSED,
147 Evas_Object *obj EINA_UNUSED, 149 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
148 void *event_info EINA_UNUSED) 150 void *event_info EINA_UNUSED)
149{ 151{
150 elm_layout_signal_emit(data, "elm,video,play", "elm"); 152 elm_layout_signal_emit(data, "elm,video,play", "elm");
151}
152 153
153static void 154 return EINA_TRUE;
154_on_playback_finished(void *data, 155
155 Evas_Object *obj EINA_UNUSED, 156}
156 void *event_info EINA_UNUSED) 157static Eina_Bool
158_on_playback_finished(void *data EINA_UNUSED,
159 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
160 void *event_info EINA_UNUSED)
157{ 161{
158 ELM_VIDEO_DATA_GET(data, sd); 162 ELM_VIDEO_DATA_GET(data, sd);
159 emotion_object_play_set(sd->emotion, EINA_FALSE); 163 emotion_object_play_set(sd->emotion, EINA_FALSE);
160 elm_layout_signal_emit(data, "elm,video,end", "elm"); 164 elm_layout_signal_emit(data, "elm,video,end", "elm");
165
166 return EINA_TRUE;
161} 167}
162 168
163static void 169static Eina_Bool
164_on_aspect_ratio_updated(void *data, 170_on_aspect_ratio_updated(void *data EINA_UNUSED,
165 Evas_Object *obj EINA_UNUSED, 171 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
166 void *event_info EINA_UNUSED) 172 void *event_info EINA_UNUSED)
167{ 173{
168 elm_layout_sizing_eval(data); 174 elm_layout_sizing_eval(data);
175
176 return EINA_TRUE;
169} 177}
170 178
171static void 179static Eina_Bool
172_on_title_changed(void *data, 180_on_title_changed(void *data EINA_UNUSED,
173 Evas_Object *obj EINA_UNUSED, 181 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
174 void *event_info EINA_UNUSED) 182 void *event_info EINA_UNUSED)
175{ 183{
176 const char *title; 184 const char *title;
177 185
@@ -180,14 +188,18 @@ _on_title_changed(void *data,
180 title = emotion_object_title_get(sd->emotion); 188 title = emotion_object_title_get(sd->emotion);
181 elm_layout_text_set(data, "elm,title", title); 189 elm_layout_text_set(data, "elm,title", title);
182 elm_layout_signal_emit(data, "elm,video,title", "elm"); 190 elm_layout_signal_emit(data, "elm,video,title", "elm");
191
192 return EINA_TRUE;
183} 193}
184 194
185static void 195static Eina_Bool
186_on_audio_level_changed(void *data, 196_on_audio_level_changed(void *data EINA_UNUSED,
187 Evas_Object *obj EINA_UNUSED, 197 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
188 void *event_info EINA_UNUSED) 198 void *event_info EINA_UNUSED)
189{ 199{
190 (void)data; 200 (void)data;
201
202 return EINA_TRUE;
191} 203}
192 204
193static Eina_Bool 205static Eina_Bool
@@ -238,18 +250,18 @@ _elm_video_evas_object_smart_add(Eo *obj, Elm_Video_Data *priv)
238 250
239 elm_layout_content_set(obj, "elm.swallow.video", priv->emotion); 251 elm_layout_content_set(obj, "elm.swallow.video", priv->emotion);
240 252
241 evas_object_smart_callback_add 253 eo_do(priv->emotion, eo_event_callback_add
242 (priv->emotion, "open_done", _on_open_done, obj); 254 (EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done, obj));
243 evas_object_smart_callback_add 255 eo_do(priv->emotion, eo_event_callback_add
244 (priv->emotion, "playback_started", _on_playback_started, obj); 256 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started, obj));
245 evas_object_smart_callback_add 257 eo_do(priv->emotion, eo_event_callback_add
246 (priv->emotion, "playback_finished", _on_playback_finished, obj); 258 (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished, obj));
247 evas_object_smart_callback_add 259 eo_do(priv->emotion, eo_event_callback_add
248 (priv->emotion, "frame_resize", _on_aspect_ratio_updated, obj); 260 (EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated, obj));
249 evas_object_smart_callback_add 261 eo_do(priv->emotion, eo_event_callback_add
250 (priv->emotion, "title_change", _on_title_changed, obj); 262 (EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed, obj));
251 evas_object_smart_callback_add 263 eo_do(priv->emotion, eo_event_callback_add
252 (priv->emotion, "audio_level_change", _on_audio_level_changed, obj); 264 (EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed, obj));
253 265
254 evas_object_event_callback_add 266 evas_object_event_callback_add
255 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); 267 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL);