summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-10-04 12:05:51 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-10-04 12:05:55 +0200
commitba30cf95b58aaeae5d877d79f8ce2d73a7dcb257 (patch)
tree82a7bf6bc9a8cb8385bdde379fce8092493f042e
parentac12f3adf246898f80085eb3bb0355d15cc113eb (diff)
elm_video: port eo_event callbacks to use eo_event arrays
Summary: Changed eo_event_callback_add to use eo_event_callback_array_add in elm_video.c Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3096 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_video.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c
index 350297152..aea83a9cd 100644
--- a/src/lib/elm_video.c
+++ b/src/lib/elm_video.c
@@ -27,6 +27,32 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
27 {NULL, NULL} 27 {NULL, NULL}
28}; 28};
29 29
30
31static Eina_Bool
32_on_open_done(void *data,
33 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
34 void *event_info EINA_UNUSED);
35static Eina_Bool
36_on_playback_started(void *data,
37 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
38 void *event_info EINA_UNUSED);
39static Eina_Bool
40_on_playback_finished(void *data,
41 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
42 void *event_info EINA_UNUSED);
43static Eina_Bool
44_on_aspect_ratio_updated(void *data,
45 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
46 void *event_info EINA_UNUSED);
47static Eina_Bool
48_on_title_changed(void *data,
49 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
50 void *event_info EINA_UNUSED);
51static Eina_Bool
52_on_audio_level_changed(void *data,
53 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
54 void *event_info EINA_UNUSED);
55
30static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); 56static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
31static Eina_Bool _key_action_play(Evas_Object *obj, const char *params); 57static Eina_Bool _key_action_play(Evas_Object *obj, const char *params);
32 58
@@ -36,6 +62,15 @@ static const Elm_Action key_actions[] = {
36 {NULL, NULL} 62 {NULL, NULL}
37}; 63};
38 64
65EO_CALLBACKS_ARRAY_DEFINE(_video_cb,
66 { EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done },
67 { EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started },
68 { EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished },
69 { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated },
70 { EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed },
71 { EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed }
72);
73
39static Eina_Bool 74static Eina_Bool
40_key_action_move(Evas_Object *obj, const char *params) 75_key_action_move(Evas_Object *obj, const char *params)
41{ 76{
@@ -155,6 +190,7 @@ _on_playback_started(void *data,
155 return EINA_TRUE; 190 return EINA_TRUE;
156 191
157} 192}
193
158static Eina_Bool 194static Eina_Bool
159_on_playback_finished(void *data, 195_on_playback_finished(void *data,
160 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, 196 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
@@ -251,18 +287,7 @@ _elm_video_evas_object_smart_add(Eo *obj, Elm_Video_Data *priv)
251 287
252 elm_layout_content_set(obj, "elm.swallow.video", priv->emotion); 288 elm_layout_content_set(obj, "elm.swallow.video", priv->emotion);
253 289
254 eo_do(priv->emotion, eo_event_callback_add 290 eo_do(priv->emotion, eo_event_callback_array_add(_video_cb(), obj));
255 (EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done, obj));
256 eo_do(priv->emotion, eo_event_callback_add
257 (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started, obj));
258 eo_do(priv->emotion, eo_event_callback_add
259 (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished, obj));
260 eo_do(priv->emotion, eo_event_callback_add
261 (EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated, obj));
262 eo_do(priv->emotion, eo_event_callback_add
263 (EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed, obj));
264 eo_do(priv->emotion, eo_event_callback_add
265 (EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed, obj));
266 291
267 evas_object_event_callback_add 292 evas_object_event_callback_add
268 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); 293 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL);