summaryrefslogtreecommitdiff
path: root/src/lib/emotion
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-08-06 13:36:06 +0100
committerTom Hacohen <tom@stosb.com>2014-08-21 11:02:11 +0100
commit5ec2aecd83271663081ffec15332bd9ccb4450e5 (patch)
tree9e82b47b43fcc063c0e5aa01edee02130ca9fb62 /src/lib/emotion
parent0f3ccbfd172ca6746910a00cb4e598a971d89d81 (diff)
Emotion object: Convert from a smart object to an eo object.
Diffstat (limited to 'src/lib/emotion')
-rw-r--r--src/lib/emotion/Emotion.h55
-rw-r--r--src/lib/emotion/Emotion_Eo.h3
-rw-r--r--src/lib/emotion/Emotion_Legacy.h2
-rw-r--r--src/lib/emotion/emotion_object.eo33
-rw-r--r--src/lib/emotion/emotion_smart.c470
5 files changed, 263 insertions, 300 deletions
diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h
index f11cbc71ec..b07cbd3062 100644
--- a/src/lib/emotion/Emotion.h
+++ b/src/lib/emotion/Emotion.h
@@ -120,6 +120,13 @@
120# endif 120# endif
121#endif /* ! _WIN32 */ 121#endif /* ! _WIN32 */
122 122
123#ifndef EFL_NOLEGACY_API_SUPPORT
124#include "Emotion_Legacy.h"
125#endif
126#ifdef EFL_EO_API_SUPPORT
127#include "Emotion_Eo.h"
128#endif
129
123/** 130/**
124 * @file Emotion.h 131 * @file Emotion.h
125 * @brief The file that provides Emotion the API, with functions available for 132 * @brief The file that provides Emotion the API, with functions available for
@@ -360,8 +367,6 @@ extern "C" {
360EAPI Eina_Bool emotion_init(void); 367EAPI Eina_Bool emotion_init(void);
361EAPI Eina_Bool emotion_shutdown(void); 368EAPI Eina_Bool emotion_shutdown(void);
362 369
363#include "emotion_object.eo.h"
364
365/** 370/**
366 * @brief Add an emotion object to the canvas. 371 * @brief Add an emotion object to the canvas.
367 * 372 *
@@ -390,52 +395,6 @@ EAPI Eina_Bool emotion_shutdown(void);
390EAPI Evas_Object *emotion_object_add (Evas *evas); 395EAPI Evas_Object *emotion_object_add (Evas *evas);
391 396
392/** 397/**
393 * @brief Set the specified option for the current module.
394 *
395 * @param obj The emotion object which the option is being set to.
396 * @param opt The option that is being set. Currently supported optiosn: "video"
397 * and "audio".
398 * @param val The value of the option. Currently only supports "off" (?!?!?!)
399 *
400 * This function allows one to mute the video or audio of the emotion object.
401 *
402 * @note Please don't use this function, consider using
403 * emotion_object_audio_mute_set() and emotion_object_video_mute_set() instead.
404 *
405 * @see emotion_object_audio_mute_set()
406 * @see emotion_object_video_mute_set()
407 *
408 * @ingroup Emotion_Init
409 */
410EAPI void emotion_object_module_option_set (Evas_Object *obj, const char *opt, const char *val);
411
412/**
413 * @brief Initializes an emotion object with the specified module.
414 *
415 * @param obj The emotion object to be initialized.
416 * @param module_filename The name of the module to be used (gstreamer or xine).
417 * @return @c EINA_TRUE if the specified module was successfully initialized for
418 * this object, @c EINA_FALSE otherwise.
419 *
420 * This function is required after creating the emotion object, in order to
421 * specify which module will be used with this object. Different objects can
422 * use different modules to play a media file. The current supported modules are
423 * @b gstreamer and @b xine.
424 *
425 * To use any of them, you need to make sure that support for them was compiled
426 * correctly.
427 *
428 * @note It's possible to disable the build of a module with
429 * --disable-module_name.
430 *
431 * @see emotion_object_add()
432 * @see emotion_object_file_set()
433 *
434 * @ingroup Emotion_Init
435 */
436EAPI Eina_Bool emotion_object_init (Evas_Object *obj, const char *module_filename);
437
438/**
439 * @brief Set borders for the emotion object. 398 * @brief Set borders for the emotion object.
440 * 399 *
441 * @param obj The emotion object where borders are being set. 400 * @param obj The emotion object where borders are being set.
diff --git a/src/lib/emotion/Emotion_Eo.h b/src/lib/emotion/Emotion_Eo.h
new file mode 100644
index 0000000000..3349189379
--- /dev/null
+++ b/src/lib/emotion/Emotion_Eo.h
@@ -0,0 +1,3 @@
1
2#include "emotion_object.eo.h"
3
diff --git a/src/lib/emotion/Emotion_Legacy.h b/src/lib/emotion/Emotion_Legacy.h
new file mode 100644
index 0000000000..eb28dff55d
--- /dev/null
+++ b/src/lib/emotion/Emotion_Legacy.h
@@ -0,0 +1,2 @@
1
2#include "emotion_object.eo.legacy.h"
diff --git a/src/lib/emotion/emotion_object.eo b/src/lib/emotion/emotion_object.eo
index 92e1b25c51..f61d2c475a 100644
--- a/src/lib/emotion/emotion_object.eo
+++ b/src/lib/emotion/emotion_object.eo
@@ -1,4 +1,4 @@
1class Emotion.Object (Efl.File, Efl.Player, Efl.Image) { 1class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image) {
2 eo_prefix: emotion_obj; 2 eo_prefix: emotion_obj;
3 properties { 3 properties {
4 option { 4 option {
@@ -53,6 +53,16 @@ class Emotion.Object (Efl.File, Efl.Player, Efl.Image) {
53 } 53 }
54 } 54 }
55 implements { 55 implements {
56 Eo.Base.constructor;
57 Evas.Object_Smart.add;
58 Evas.Object_Smart.del;
59 Evas.Object_Smart.move;
60 Evas.Object_Smart.resize;
61 Evas.Object_Smart.show;
62 Evas.Object_Smart.hide;
63 Evas.Object_Smart.color.set;
64 Evas.Object_Smart.clip.set;
65 Evas.Object_Smart.clip_unset;
56 Efl.File.file.set; 66 Efl.File.file.set;
57 Efl.File.file.get; 67 Efl.File.file.get;
58 Efl.Player.play.set; 68 Efl.Player.play.set;
@@ -69,6 +79,27 @@ class Emotion.Object (Efl.File, Efl.Player, Efl.Image) {
69 Efl.Image.smooth_scale.set; 79 Efl.Image.smooth_scale.set;
70 Efl.Image.smooth_scale.get; 80 Efl.Image.smooth_scale.get;
71 } 81 }
82 events {
83 frame_decode;
84 position_update;
85 length_change;
86 frame_resize;
87 decode_stop;
88 playback_started;
89 playback_finished;
90 audio_level_change;
91 channels_change;
92 title_change;
93 progress_change;
94 ref_change;
95 button_num_change;
96 button_change;
97 open_done;
98 position_save,succeed;
99 position_save,failed;
100 position_load,succeed;
101 position_load,failed;
102 }
72} 103}
73 104
74/* FIXME: Need to be added: 105/* FIXME: Need to be added:
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index dc809d77a9..16c4c08038 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -21,33 +21,37 @@
21 21
22#define E_SMART_OBJ_GET(smart, o, type) \ 22#define E_SMART_OBJ_GET(smart, o, type) \
23 { \ 23 { \
24 char *_e_smart_str; \
25 \
26 if (!o) return; \ 24 if (!o) return; \
27 smart = evas_object_smart_data_get(o); \ 25 if (!eo_isa(o, MY_CLASS)) { \
26 ERR("Tried calling on a non-emotion object."); \
27 return; \
28 } \
29 smart = eo_data_scope_get(o, MY_CLASS); \
28 if (!smart) return; \ 30 if (!smart) return; \
29 _e_smart_str = (char *)evas_object_type_get(o); \
30 if (!_e_smart_str) return; \
31 if (strcmp(_e_smart_str, type)) return; \
32 } 31 }
33 32
34#define E_SMART_OBJ_GET_RETURN(smart, o, type, ret) \ 33#define E_SMART_OBJ_GET_RETURN(smart, o, type, ret) \
35 { \ 34 { \
36 char *_e_smart_str; \
37 \
38 if (!o) return ret; \ 35 if (!o) return ret; \
39 smart = evas_object_smart_data_get(o); \ 36 if (!eo_isa(o, MY_CLASS)) { \
37 ERR("Tried calling on a non-emotion object."); \
38 return ret; \
39 } \
40 smart = eo_data_scope_get(o, MY_CLASS); \
40 if (!smart) return ret; \ 41 if (!smart) return ret; \
41 _e_smart_str = (char *)evas_object_type_get(o); \
42 if (!_e_smart_str) return ret; \
43 if (strcmp(_e_smart_str, type)) return ret; \
44 } 42 }
45 43
46#define E_OBJ_NAME "emotion_object" 44#define E_OBJ_NAME "emotion_object"
47 45
48typedef struct _Smart_Data Smart_Data; 46#ifdef MY_CLASS
47# undef MY_CLASS
48#endif
49
50#define MY_CLASS EMOTION_OBJECT_CLASS
49 51
50struct _Smart_Data 52typedef struct _Emotion_Object_Data Emotion_Object_Data;
53
54struct _Emotion_Object_Data
51{ 55{
52 EINA_REFCOUNT; 56 EINA_REFCOUNT;
53 Emotion_Engine_Instance *engine_instance; 57 Emotion_Engine_Instance *engine_instance;
@@ -118,22 +122,9 @@ static void _mouse_down(void *data, Evas *ev, Evas_Object *obj, void *event_info
118static void _pos_set_job(void *data); 122static void _pos_set_job(void *data);
119static void _pixels_get(void *data, Evas_Object *obj); 123static void _pixels_get(void *data, Evas_Object *obj);
120 124
121static void _smart_init(void);
122static void _smart_add(Evas_Object * obj);
123static void _smart_del(Evas_Object * obj);
124static void _smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y);
125static void _smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h);
126static void _smart_show(Evas_Object * obj);
127static void _smart_hide(Evas_Object * obj);
128static void _smart_color_set(Evas_Object * obj, int r, int g, int b, int a);
129static void _smart_clip_set(Evas_Object * obj, Evas_Object * clip);
130static void _smart_clip_unset(Evas_Object * obj);
131
132/**********************************/ 125/**********************************/
133/* Globals for the E Video Object */ 126/* Globals for the E Video Object */
134/**********************************/ 127/**********************************/
135static Evas_Smart *smart = NULL;
136
137static const char SIG_FRAME_DECODE[] = "frame_decode"; 128static const char SIG_FRAME_DECODE[] = "frame_decode";
138static const char SIG_POSITION_UPDATE[] = "position_update"; 129static const char SIG_POSITION_UPDATE[] = "position_update";
139static const char SIG_LENGTH_CHANGE[] = "length_change"; 130static const char SIG_LENGTH_CHANGE[] = "length_change";
@@ -154,25 +145,6 @@ static const char SIG_POSITION_SAVE_FAILED[] = "position_save,failed";
154static const char SIG_POSITION_LOAD_SUCCEED[] = "position_load,succeed"; 145static const char SIG_POSITION_LOAD_SUCCEED[] = "position_load,succeed";
155static const char SIG_POSITION_LOAD_FAILED[] = "position_load,failed"; 146static const char SIG_POSITION_LOAD_FAILED[] = "position_load,failed";
156 147
157static const Evas_Smart_Cb_Description _smart_callbacks[] = {
158 {SIG_FRAME_DECODE, ""},
159 {SIG_POSITION_UPDATE, ""},
160 {SIG_LENGTH_CHANGE, ""},
161 {SIG_FRAME_RESIZE, ""},
162 {SIG_DECODE_STOP, ""},
163 {SIG_PLAYBACK_STARTED, ""},
164 {SIG_PLAYBACK_FINISHED, ""},
165 {SIG_AUDIO_LEVEL_CHANGE, ""},
166 {SIG_CHANNELS_CHANGE, ""},
167 {SIG_TITLE_CHANGE, ""},
168 {SIG_PROGRESS_CHANGE, ""},
169 {SIG_REF_CHANGE, ""},
170 {SIG_BUTTON_NUM_CHANGE, ""},
171 {SIG_BUTTON_CHANGE, ""},
172 {SIG_OPEN_DONE, ""},
173 {NULL, NULL}
174};
175
176static void 148static void
177_emotion_image_data_zero(Evas_Object *img) 149_emotion_image_data_zero(Evas_Object *img)
178{ 150{
@@ -197,7 +169,7 @@ _emotion_image_data_zero(Evas_Object *img)
197} 169}
198 170
199static void 171static void
200_smart_data_free(Smart_Data *sd) 172_smart_data_free(Emotion_Object_Data *sd)
201{ 173{
202#ifdef HAVE_EIO 174#ifdef HAVE_EIO
203 /* Only cancel the load_xattr or we will loose ref to time_seek stringshare */ 175 /* Only cancel the load_xattr or we will loose ref to time_seek stringshare */
@@ -229,7 +201,6 @@ _smart_data_free(Smart_Data *sd)
229 sd->progress.info = NULL; 201 sd->progress.info = NULL;
230 eina_stringshare_del(sd->ref.file); 202 eina_stringshare_del(sd->ref.file);
231 sd->ref.file = NULL; 203 sd->ref.file = NULL;
232 free(sd);
233 204
234 /* TODO: remove legacy: emotion used to have no shutdown, call automatically */ 205 /* TODO: remove legacy: emotion used to have no shutdown, call automatically */
235 emotion_shutdown(); 206 emotion_shutdown();
@@ -238,7 +209,7 @@ _smart_data_free(Smart_Data *sd)
238static void 209static void
239_clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int vid_w, int vid_h) 210_clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int vid_w, int vid_h)
240{ 211{
241 Smart_Data *sd; 212 Emotion_Object_Data *sd;
242 double scale_w, scale_h; 213 double scale_w, scale_h;
243 214
244 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 215 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -276,26 +247,34 @@ _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int
276EAPI Evas_Object * 247EAPI Evas_Object *
277emotion_object_add(Evas *evas) 248emotion_object_add(Evas *evas)
278{ 249{
279 _smart_init(); 250 Evas_Object *e;
280 return evas_object_smart_add(evas, smart); 251 e = eo_add(MY_CLASS, evas);
252 eo_unref(e);
253 return e;
254}
255
256EOLIAN static void
257_emotion_object_eo_base_constructor(Eo *obj, Emotion_Object_Data *pd EINA_UNUSED)
258{
259 eo_do_super(obj, MY_CLASS, eo_constructor());
260 eo_do(obj, evas_obj_type_set(E_OBJ_NAME));
281} 261}
282 262
283EAPI Evas_Object * 263EAPI Evas_Object *
284emotion_object_image_get(const Evas_Object *obj) 264emotion_object_image_get(const Evas_Object *obj)
285{ 265{
286 Smart_Data *sd; 266 Emotion_Object_Data *sd;
287 267
288 sd = evas_object_smart_data_get(obj); 268 sd = evas_object_smart_data_get(obj);
289 if (!sd) return NULL; 269 if (!sd) return NULL;
290 return sd->obj; 270 return sd->obj;
291} 271}
292 272
293EAPI void 273EOLIAN static void
294emotion_object_module_option_set(Evas_Object *obj, const char *opt, const char *val) 274_emotion_object_option_set(Eo *obj EINA_UNUSED, Emotion_Object_Data *pd, const char *opt, const char *val)
295{ 275{
296 Smart_Data *sd; 276 Emotion_Object_Data *sd = pd;
297 277
298 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
299 if ((!opt) || (!val)) return; 278 if ((!opt) || (!val)) return;
300 279
301 if (strcmp(opt, "video") == 0) 280 if (strcmp(opt, "video") == 0)
@@ -324,10 +303,10 @@ emotion_object_module_option_set(Evas_Object *obj, const char *opt, const char *
324 ERR("Unsupported %s=%s", opt, val); 303 ERR("Unsupported %s=%s", opt, val);
325} 304}
326 305
327EAPI Eina_Bool 306EOLIAN static Eina_Bool
328emotion_object_init(Evas_Object *obj, const char *module_filename) 307_emotion_object_engine_set(Eo *obj, Emotion_Object_Data *pd, const char *module_filename)
329{ 308{
330 Smart_Data *sd; 309 Emotion_Object_Data *sd = pd;
331 const char *file; 310 const char *file;
332 311
333 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 312 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
@@ -381,10 +360,12 @@ emotion_object_init(Evas_Object *obj, const char *module_filename)
381EAPI Eina_Bool 360EAPI Eina_Bool
382emotion_object_file_set(Evas_Object *obj, const char *file) 361emotion_object_file_set(Evas_Object *obj, const char *file)
383{ 362{
384 Smart_Data *sd; 363 return eo_do(obj, efl_file_set(file, NULL));
385 364}
386 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EINA_FALSE);
387 365
366EOLIAN static Eina_Bool
367_emotion_object_efl_file_file_set(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, const char *file, const char *key EINA_UNUSED)
368{
388 DBG("file=%s", file); 369 DBG("file=%s", file);
389 370
390 if (!eina_stringshare_replace(&sd->file, file)) 371 if (!eina_stringshare_replace(&sd->file, file))
@@ -441,14 +422,20 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
441EAPI const char * 422EAPI const char *
442emotion_object_file_get(const Evas_Object *obj) 423emotion_object_file_get(const Evas_Object *obj)
443{ 424{
444 Smart_Data *sd; 425 const char *file = NULL;
426 eo_do(obj, efl_file_get(&file, NULL));
427 return file;
428}
445 429
446 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 430EOLIAN void
447 return sd->file; 431_emotion_object_efl_file_file_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, const char **file, const char **key)
432{
433 if (file) *file = sd->file;
434 if (key) *key = NULL;
448} 435}
449 436
450static void 437static void
451_emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, int iw, int ih) 438_emotion_aspect_borders_apply(Evas_Object *obj, Emotion_Object_Data *sd, int w, int h, int iw, int ih)
452{ 439{
453 int x, y; 440 int x, y;
454 441
@@ -488,7 +475,7 @@ _emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, in
488} 475}
489 476
490static void 477static void
491_emotion_object_aspect_border_apply(Evas_Object *obj, Smart_Data *sd, int w, int h) 478_emotion_object_aspect_border_apply(Evas_Object *obj, Emotion_Object_Data *sd, int w, int h)
492{ 479{
493 int iw, ih; 480 int iw, ih;
494 double ir; 481 double ir;
@@ -575,7 +562,7 @@ _emotion_object_aspect_border_apply(Evas_Object *obj, Smart_Data *sd, int w, int
575EAPI void 562EAPI void
576emotion_object_border_set(Evas_Object *obj, int l, int r, int t, int b) 563emotion_object_border_set(Evas_Object *obj, int l, int r, int t, int b)
577{ 564{
578 Smart_Data *sd; 565 Emotion_Object_Data *sd;
579 int w, h; 566 int w, h;
580 567
581 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 568 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -592,7 +579,7 @@ emotion_object_border_set(Evas_Object *obj, int l, int r, int t, int b)
592EAPI void 579EAPI void
593emotion_object_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) 580emotion_object_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
594{ 581{
595 Smart_Data *sd; 582 Emotion_Object_Data *sd;
596 583
597 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 584 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
598 *l = -sd->crop.l; 585 *l = -sd->crop.l;
@@ -604,7 +591,7 @@ emotion_object_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b
604EAPI void 591EAPI void
605emotion_object_bg_color_set(Evas_Object *obj, int r, int g, int b, int a) 592emotion_object_bg_color_set(Evas_Object *obj, int r, int g, int b, int a)
606{ 593{
607 Smart_Data *sd; 594 Emotion_Object_Data *sd;
608 595
609 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 596 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
610 597
@@ -622,7 +609,7 @@ emotion_object_bg_color_set(Evas_Object *obj, int r, int g, int b, int a)
622EAPI void 609EAPI void
623emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) 610emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
624{ 611{
625 Smart_Data *sd; 612 Emotion_Object_Data *sd;
626 613
627 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 614 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
628 evas_object_color_get(sd->bg, r, g, b, a); 615 evas_object_color_get(sd->bg, r, g, b, a);
@@ -631,7 +618,7 @@ emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int
631EAPI void 618EAPI void
632emotion_object_keep_aspect_set(Evas_Object *obj, Emotion_Aspect a) 619emotion_object_keep_aspect_set(Evas_Object *obj, Emotion_Aspect a)
633{ 620{
634 Smart_Data *sd; 621 Emotion_Object_Data *sd;
635 int w, h; 622 int w, h;
636 623
637 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 624 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -647,7 +634,7 @@ emotion_object_keep_aspect_set(Evas_Object *obj, Emotion_Aspect a)
647EAPI Emotion_Aspect 634EAPI Emotion_Aspect
648emotion_object_keep_aspect_get(const Evas_Object *obj) 635emotion_object_keep_aspect_get(const Evas_Object *obj)
649{ 636{
650 Smart_Data *sd; 637 Emotion_Object_Data *sd;
651 638
652 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_ASPECT_KEEP_NONE); 639 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_ASPECT_KEEP_NONE);
653 640
@@ -657,9 +644,12 @@ emotion_object_keep_aspect_get(const Evas_Object *obj)
657EAPI void 644EAPI void
658emotion_object_play_set(Evas_Object *obj, Eina_Bool play) 645emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
659{ 646{
660 Smart_Data *sd; 647 eo_do(obj, efl_player_play_set(play));
648}
661 649
662 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 650EOLIAN static void
651_emotion_object_efl_player_play_set(Eo *obj, Emotion_Object_Data *sd, Eina_Bool play)
652{
663 DBG("play=" FMT_UCHAR ", was=" FMT_UCHAR, play, sd->play); 653 DBG("play=" FMT_UCHAR ", was=" FMT_UCHAR, play, sd->play);
664 if (!sd->engine_instance) return; 654 if (!sd->engine_instance) return;
665 if (!sd->open) 655 if (!sd->open)
@@ -678,9 +668,12 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
678EAPI Eina_Bool 668EAPI Eina_Bool
679emotion_object_play_get(const Evas_Object *obj) 669emotion_object_play_get(const Evas_Object *obj)
680{ 670{
681 Smart_Data *sd; 671 return eo_do(obj, efl_player_play_get());
672}
682 673
683 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 674EOLIAN static Eina_Bool
675_emotion_object_efl_player_play_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
676{
684 if (!sd->engine_instance) return EINA_FALSE; 677 if (!sd->engine_instance) return EINA_FALSE;
685 678
686 return sd->play; 679 return sd->play;
@@ -689,9 +682,12 @@ emotion_object_play_get(const Evas_Object *obj)
689EAPI void 682EAPI void
690emotion_object_position_set(Evas_Object *obj, double sec) 683emotion_object_position_set(Evas_Object *obj, double sec)
691{ 684{
692 Smart_Data *sd; 685 eo_do(obj, efl_player_position_set(sec));
686}
693 687
694 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 688EOLIAN static void
689_emotion_object_efl_player_position_set(Eo *obj, Emotion_Object_Data *sd, double sec)
690{
695 DBG("sec=%f", sec); 691 DBG("sec=%f", sec);
696 if (!sd->engine_instance) return; 692 if (!sd->engine_instance) return;
697 if (!sd->open) 693 if (!sd->open)
@@ -710,9 +706,12 @@ emotion_object_position_set(Evas_Object *obj, double sec)
710EAPI double 706EAPI double
711emotion_object_position_get(const Evas_Object *obj) 707emotion_object_position_get(const Evas_Object *obj)
712{ 708{
713 Smart_Data *sd; 709 return eo_do(obj, efl_player_position_get());
710}
714 711
715 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 712EOLIAN static double
713_emotion_object_efl_player_position_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
714{
716 sd->pos = emotion_engine_instance_pos_get(sd->engine_instance); 715 sd->pos = emotion_engine_instance_pos_get(sd->engine_instance);
717 return sd->pos; 716 return sd->pos;
718} 717}
@@ -720,7 +719,7 @@ emotion_object_position_get(const Evas_Object *obj)
720EAPI double 719EAPI double
721emotion_object_buffer_size_get(const Evas_Object *obj) 720emotion_object_buffer_size_get(const Evas_Object *obj)
722{ 721{
723 Smart_Data *sd; 722 Emotion_Object_Data *sd;
724 723
725 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 724 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
726 return emotion_engine_instance_buffer_size_get(sd->engine_instance); 725 return emotion_engine_instance_buffer_size_get(sd->engine_instance);
@@ -729,7 +728,7 @@ emotion_object_buffer_size_get(const Evas_Object *obj)
729EAPI Eina_Bool 728EAPI Eina_Bool
730emotion_object_seekable_get(const Evas_Object *obj) 729emotion_object_seekable_get(const Evas_Object *obj)
731{ 730{
732 Smart_Data *sd; 731 Emotion_Object_Data *sd;
733 732
734 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 733 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
735 return emotion_engine_instance_seekable(sd->engine_instance); 734 return emotion_engine_instance_seekable(sd->engine_instance);
@@ -738,7 +737,7 @@ emotion_object_seekable_get(const Evas_Object *obj)
738EAPI Eina_Bool 737EAPI Eina_Bool
739emotion_object_video_handled_get(const Evas_Object *obj) 738emotion_object_video_handled_get(const Evas_Object *obj)
740{ 739{
741 Smart_Data *sd; 740 Emotion_Object_Data *sd;
742 741
743 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 742 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
744 return emotion_engine_instance_video_handled(sd->engine_instance); 743 return emotion_engine_instance_video_handled(sd->engine_instance);
@@ -747,7 +746,7 @@ emotion_object_video_handled_get(const Evas_Object *obj)
747EAPI Eina_Bool 746EAPI Eina_Bool
748emotion_object_audio_handled_get(const Evas_Object *obj) 747emotion_object_audio_handled_get(const Evas_Object *obj)
749{ 748{
750 Smart_Data *sd; 749 Emotion_Object_Data *sd;
751 750
752 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 751 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
753 return emotion_engine_instance_audio_handled(sd->engine_instance); 752 return emotion_engine_instance_audio_handled(sd->engine_instance);
@@ -756,7 +755,7 @@ emotion_object_audio_handled_get(const Evas_Object *obj)
756EAPI double 755EAPI double
757emotion_object_play_length_get(const Evas_Object *obj) 756emotion_object_play_length_get(const Evas_Object *obj)
758{ 757{
759 Smart_Data *sd; 758 Emotion_Object_Data *sd;
760 759
761 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 760 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
762 sd->len = emotion_engine_instance_len_get(sd->engine_instance); 761 sd->len = emotion_engine_instance_len_get(sd->engine_instance);
@@ -766,11 +765,15 @@ emotion_object_play_length_get(const Evas_Object *obj)
766EAPI void 765EAPI void
767emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih) 766emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
768{ 767{
769 Smart_Data *sd;
770
771 if (iw) *iw = 0; 768 if (iw) *iw = 0;
772 if (ih) *ih = 0; 769 if (ih) *ih = 0;
773 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 770
771 eo_do(obj, efl_image_load_size_get(iw, ih));
772}
773
774EOLIAN static void
775_emotion_object_efl_image_load_size_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, int *iw, int *ih)
776{
774 if (iw) *iw = sd->video.w; 777 if (iw) *iw = sd->video.w;
775 if (ih) *ih = sd->video.h; 778 if (ih) *ih = sd->video.h;
776} 779}
@@ -778,27 +781,36 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
778EAPI void 781EAPI void
779emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth) 782emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth)
780{ 783{
781 Smart_Data *sd; 784 eo_do(obj, efl_image_smooth_scale_set(smooth));
785}
782 786
783 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 787EOLIAN static void
788_emotion_object_efl_image_smooth_scale_set(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, Eina_Bool smooth)
789{
784 evas_object_image_smooth_scale_set(sd->obj, smooth); 790 evas_object_image_smooth_scale_set(sd->obj, smooth);
785} 791}
786 792
787EAPI Eina_Bool 793EAPI Eina_Bool
788emotion_object_smooth_scale_get(const Evas_Object *obj) 794emotion_object_smooth_scale_get(const Evas_Object *obj)
789{ 795{
790 Smart_Data *sd; 796 return eo_do(obj, efl_image_smooth_scale_get());
797}
791 798
792 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 799EOLIAN static Eina_Bool
800_emotion_object_efl_image_smooth_scale_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
801{
793 return evas_object_image_smooth_scale_get(sd->obj); 802 return evas_object_image_smooth_scale_get(sd->obj);
794} 803}
795 804
796EAPI double 805EAPI double
797emotion_object_ratio_get(const Evas_Object *obj) 806emotion_object_ratio_get(const Evas_Object *obj)
798{ 807{
799 Smart_Data *sd; 808 return eo_do(obj, efl_image_ratio_get());
809}
800 810
801 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 811EOLIAN static double
812_emotion_object_efl_image_ratio_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
813{
802 if (!sd->engine_instance) return 0.0; 814 if (!sd->engine_instance) return 0.0;
803 return sd->ratio; 815 return sd->ratio;
804} 816}
@@ -809,7 +821,7 @@ emotion_object_ratio_get(const Evas_Object *obj)
809EAPI void 821EAPI void
810emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev) 822emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev)
811{ 823{
812 Smart_Data *sd; 824 Emotion_Object_Data *sd;
813 825
814 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 826 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
815 emotion_engine_instance_event_feed(sd->engine_instance, ev); 827 emotion_engine_instance_event_feed(sd->engine_instance, ev);
@@ -818,9 +830,12 @@ emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev)
818EAPI void 830EAPI void
819emotion_object_audio_volume_set(Evas_Object *obj, double vol) 831emotion_object_audio_volume_set(Evas_Object *obj, double vol)
820{ 832{
821 Smart_Data *sd; 833 eo_do(obj, efl_player_audio_volume_set(vol));
834}
822 835
823 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 836EOLIAN static void
837_emotion_object_efl_player_audio_volume_set(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, double vol)
838{
824 DBG("vol=%f", vol); 839 DBG("vol=%f", vol);
825 emotion_engine_instance_audio_channel_volume_set(sd->engine_instance, vol); 840 emotion_engine_instance_audio_channel_volume_set(sd->engine_instance, vol);
826} 841}
@@ -828,18 +843,24 @@ emotion_object_audio_volume_set(Evas_Object *obj, double vol)
828EAPI double 843EAPI double
829emotion_object_audio_volume_get(const Evas_Object *obj) 844emotion_object_audio_volume_get(const Evas_Object *obj)
830{ 845{
831 Smart_Data *sd; 846 return eo_do(obj, efl_player_audio_volume_get());
847}
832 848
833 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 849EOLIAN static double
850_emotion_object_efl_player_audio_volume_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
851{
834 return emotion_engine_instance_audio_channel_volume_get(sd->engine_instance); 852 return emotion_engine_instance_audio_channel_volume_get(sd->engine_instance);
835} 853}
836 854
837EAPI void 855EAPI void
838emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute) 856emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
839{ 857{
840 Smart_Data *sd; 858 eo_do(obj, efl_player_audio_mute_set(mute));
859}
841 860
842 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 861EOLIAN static void
862_emotion_object_efl_player_audio_mute_set(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, Eina_Bool mute)
863{
843 DBG("mute=" FMT_UCHAR, mute); 864 DBG("mute=" FMT_UCHAR, mute);
844 emotion_engine_instance_audio_channel_mute_set(sd->engine_instance, mute); 865 emotion_engine_instance_audio_channel_mute_set(sd->engine_instance, mute);
845} 866}
@@ -847,16 +868,19 @@ emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
847EAPI Eina_Bool 868EAPI Eina_Bool
848emotion_object_audio_mute_get(const Evas_Object *obj) 869emotion_object_audio_mute_get(const Evas_Object *obj)
849{ 870{
850 Smart_Data *sd; 871 return eo_do(obj, efl_player_audio_mute_get());
872}
851 873
852 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 874EOLIAN static Eina_Bool
875_emotion_object_efl_player_audio_mute_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
876{
853 return emotion_engine_instance_audio_channel_mute_get(sd->engine_instance); 877 return emotion_engine_instance_audio_channel_mute_get(sd->engine_instance);
854} 878}
855 879
856EAPI int 880EAPI int
857emotion_object_audio_channel_count(const Evas_Object *obj) 881emotion_object_audio_channel_count(const Evas_Object *obj)
858{ 882{
859 Smart_Data *sd; 883 Emotion_Object_Data *sd;
860 884
861 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 885 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
862 return emotion_engine_instance_audio_channel_count(sd->engine_instance); 886 return emotion_engine_instance_audio_channel_count(sd->engine_instance);
@@ -865,7 +889,7 @@ emotion_object_audio_channel_count(const Evas_Object *obj)
865EAPI const char * 889EAPI const char *
866emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel) 890emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel)
867{ 891{
868 Smart_Data *sd; 892 Emotion_Object_Data *sd;
869 893
870 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 894 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
871 return emotion_engine_instance_audio_channel_name_get(sd->engine_instance, channel); 895 return emotion_engine_instance_audio_channel_name_get(sd->engine_instance, channel);
@@ -874,7 +898,7 @@ emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel)
874EAPI void 898EAPI void
875emotion_object_audio_channel_set(Evas_Object *obj, int channel) 899emotion_object_audio_channel_set(Evas_Object *obj, int channel)
876{ 900{
877 Smart_Data *sd; 901 Emotion_Object_Data *sd;
878 902
879 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 903 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
880 DBG("channel=%d", channel); 904 DBG("channel=%d", channel);
@@ -884,7 +908,7 @@ emotion_object_audio_channel_set(Evas_Object *obj, int channel)
884EAPI int 908EAPI int
885emotion_object_audio_channel_get(const Evas_Object *obj) 909emotion_object_audio_channel_get(const Evas_Object *obj)
886{ 910{
887 Smart_Data *sd; 911 Emotion_Object_Data *sd;
888 912
889 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 913 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
890 return emotion_engine_instance_audio_channel_get(sd->engine_instance); 914 return emotion_engine_instance_audio_channel_get(sd->engine_instance);
@@ -893,7 +917,7 @@ emotion_object_audio_channel_get(const Evas_Object *obj)
893EAPI void 917EAPI void
894emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute) 918emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
895{ 919{
896 Smart_Data *sd; 920 Emotion_Object_Data *sd;
897 921
898 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 922 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
899 DBG("mute=" FMT_UCHAR, mute); 923 DBG("mute=" FMT_UCHAR, mute);
@@ -903,7 +927,7 @@ emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
903EAPI Eina_Bool 927EAPI Eina_Bool
904emotion_object_video_mute_get(const Evas_Object *obj) 928emotion_object_video_mute_get(const Evas_Object *obj)
905{ 929{
906 Smart_Data *sd; 930 Emotion_Object_Data *sd;
907 931
908 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 932 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
909 return emotion_engine_instance_video_channel_mute_get(sd->engine_instance); 933 return emotion_engine_instance_video_channel_mute_get(sd->engine_instance);
@@ -912,7 +936,7 @@ emotion_object_video_mute_get(const Evas_Object *obj)
912EAPI void 936EAPI void
913emotion_object_video_subtitle_file_set(Evas_Object *obj, const char *filepath) 937emotion_object_video_subtitle_file_set(Evas_Object *obj, const char *filepath)
914{ 938{
915 Smart_Data *sd; 939 Emotion_Object_Data *sd;
916 940
917 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 941 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
918 DBG("subtitle=%s", filepath); 942 DBG("subtitle=%s", filepath);
@@ -922,7 +946,7 @@ emotion_object_video_subtitle_file_set(Evas_Object *obj, const char *filepath)
922EAPI const char * 946EAPI const char *
923emotion_object_video_subtitle_file_get(const Evas_Object *obj) 947emotion_object_video_subtitle_file_get(const Evas_Object *obj)
924{ 948{
925 Smart_Data *sd; 949 Emotion_Object_Data *sd;
926 950
927 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 951 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
928 return emotion_engine_instance_video_subtitle_file_get(sd->engine_instance); 952 return emotion_engine_instance_video_subtitle_file_get(sd->engine_instance);
@@ -931,7 +955,7 @@ emotion_object_video_subtitle_file_get(const Evas_Object *obj)
931EAPI int 955EAPI int
932emotion_object_video_channel_count(const Evas_Object *obj) 956emotion_object_video_channel_count(const Evas_Object *obj)
933{ 957{
934 Smart_Data *sd; 958 Emotion_Object_Data *sd;
935 959
936 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 960 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
937 return emotion_engine_instance_video_channel_count(sd->engine_instance); 961 return emotion_engine_instance_video_channel_count(sd->engine_instance);
@@ -940,7 +964,7 @@ emotion_object_video_channel_count(const Evas_Object *obj)
940EAPI const char * 964EAPI const char *
941emotion_object_video_channel_name_get(const Evas_Object *obj, int channel) 965emotion_object_video_channel_name_get(const Evas_Object *obj, int channel)
942{ 966{
943 Smart_Data *sd; 967 Emotion_Object_Data *sd;
944 968
945 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 969 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
946 return emotion_engine_instance_video_channel_name_get(sd->engine_instance, channel); 970 return emotion_engine_instance_video_channel_name_get(sd->engine_instance, channel);
@@ -949,7 +973,7 @@ emotion_object_video_channel_name_get(const Evas_Object *obj, int channel)
949EAPI void 973EAPI void
950emotion_object_video_channel_set(Evas_Object *obj, int channel) 974emotion_object_video_channel_set(Evas_Object *obj, int channel)
951{ 975{
952 Smart_Data *sd; 976 Emotion_Object_Data *sd;
953 977
954 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 978 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
955 DBG("channel=%d", channel); 979 DBG("channel=%d", channel);
@@ -959,7 +983,7 @@ emotion_object_video_channel_set(Evas_Object *obj, int channel)
959EAPI int 983EAPI int
960emotion_object_video_channel_get(const Evas_Object *obj) 984emotion_object_video_channel_get(const Evas_Object *obj)
961{ 985{
962 Smart_Data *sd; 986 Emotion_Object_Data *sd;
963 987
964 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 988 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
965 return emotion_engine_instance_video_channel_get(sd->engine_instance); 989 return emotion_engine_instance_video_channel_get(sd->engine_instance);
@@ -968,7 +992,7 @@ emotion_object_video_channel_get(const Evas_Object *obj)
968EAPI void 992EAPI void
969emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute) 993emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
970{ 994{
971 Smart_Data *sd; 995 Emotion_Object_Data *sd;
972 996
973 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 997 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
974 DBG("mute=" FMT_UCHAR, mute); 998 DBG("mute=" FMT_UCHAR, mute);
@@ -978,7 +1002,7 @@ emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
978EAPI Eina_Bool 1002EAPI Eina_Bool
979emotion_object_spu_mute_get(const Evas_Object *obj) 1003emotion_object_spu_mute_get(const Evas_Object *obj)
980{ 1004{
981 Smart_Data *sd; 1005 Emotion_Object_Data *sd;
982 1006
983 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1007 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
984 return emotion_engine_instance_spu_channel_mute_get(sd->engine_instance); 1008 return emotion_engine_instance_spu_channel_mute_get(sd->engine_instance);
@@ -987,7 +1011,7 @@ emotion_object_spu_mute_get(const Evas_Object *obj)
987EAPI int 1011EAPI int
988emotion_object_spu_channel_count(const Evas_Object *obj) 1012emotion_object_spu_channel_count(const Evas_Object *obj)
989{ 1013{
990 Smart_Data *sd; 1014 Emotion_Object_Data *sd;
991 1015
992 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1016 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
993 return emotion_engine_instance_spu_channel_count(sd->engine_instance); 1017 return emotion_engine_instance_spu_channel_count(sd->engine_instance);
@@ -996,7 +1020,7 @@ emotion_object_spu_channel_count(const Evas_Object *obj)
996EAPI const char * 1020EAPI const char *
997emotion_object_spu_channel_name_get(const Evas_Object *obj, int channel) 1021emotion_object_spu_channel_name_get(const Evas_Object *obj, int channel)
998{ 1022{
999 Smart_Data *sd; 1023 Emotion_Object_Data *sd;
1000 1024
1001 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1025 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1002 return emotion_engine_instance_spu_channel_name_get(sd->engine_instance, channel); 1026 return emotion_engine_instance_spu_channel_name_get(sd->engine_instance, channel);
@@ -1005,7 +1029,7 @@ emotion_object_spu_channel_name_get(const Evas_Object *obj, int channel)
1005EAPI void 1029EAPI void
1006emotion_object_spu_channel_set(Evas_Object *obj, int channel) 1030emotion_object_spu_channel_set(Evas_Object *obj, int channel)
1007{ 1031{
1008 Smart_Data *sd; 1032 Emotion_Object_Data *sd;
1009 1033
1010 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1034 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1011 DBG("channel=%d", channel); 1035 DBG("channel=%d", channel);
@@ -1015,7 +1039,7 @@ emotion_object_spu_channel_set(Evas_Object *obj, int channel)
1015EAPI int 1039EAPI int
1016emotion_object_spu_channel_get(const Evas_Object *obj) 1040emotion_object_spu_channel_get(const Evas_Object *obj)
1017{ 1041{
1018 Smart_Data *sd; 1042 Emotion_Object_Data *sd;
1019 1043
1020 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1044 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1021 return emotion_engine_instance_spu_channel_get(sd->engine_instance); 1045 return emotion_engine_instance_spu_channel_get(sd->engine_instance);
@@ -1024,7 +1048,7 @@ emotion_object_spu_channel_get(const Evas_Object *obj)
1024EAPI int 1048EAPI int
1025emotion_object_chapter_count(const Evas_Object *obj) 1049emotion_object_chapter_count(const Evas_Object *obj)
1026{ 1050{
1027 Smart_Data *sd; 1051 Emotion_Object_Data *sd;
1028 1052
1029 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1053 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1030 return emotion_engine_instance_chapter_count(sd->engine_instance); 1054 return emotion_engine_instance_chapter_count(sd->engine_instance);
@@ -1033,7 +1057,7 @@ emotion_object_chapter_count(const Evas_Object *obj)
1033EAPI void 1057EAPI void
1034emotion_object_chapter_set(Evas_Object *obj, int chapter) 1058emotion_object_chapter_set(Evas_Object *obj, int chapter)
1035{ 1059{
1036 Smart_Data *sd; 1060 Emotion_Object_Data *sd;
1037 1061
1038 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1062 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1039 DBG("chapter=%d", chapter); 1063 DBG("chapter=%d", chapter);
@@ -1043,7 +1067,7 @@ emotion_object_chapter_set(Evas_Object *obj, int chapter)
1043EAPI int 1067EAPI int
1044emotion_object_chapter_get(const Evas_Object *obj) 1068emotion_object_chapter_get(const Evas_Object *obj)
1045{ 1069{
1046 Smart_Data *sd; 1070 Emotion_Object_Data *sd;
1047 1071
1048 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1072 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1049 return emotion_engine_instance_chapter_get(sd->engine_instance); 1073 return emotion_engine_instance_chapter_get(sd->engine_instance);
@@ -1052,7 +1076,7 @@ emotion_object_chapter_get(const Evas_Object *obj)
1052EAPI const char * 1076EAPI const char *
1053emotion_object_chapter_name_get(const Evas_Object *obj, int chapter) 1077emotion_object_chapter_name_get(const Evas_Object *obj, int chapter)
1054{ 1078{
1055 Smart_Data *sd; 1079 Emotion_Object_Data *sd;
1056 1080
1057 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1081 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1058 return emotion_engine_instance_chapter_name_get(sd->engine_instance, chapter); 1082 return emotion_engine_instance_chapter_name_get(sd->engine_instance, chapter);
@@ -1061,7 +1085,7 @@ emotion_object_chapter_name_get(const Evas_Object *obj, int chapter)
1061EAPI void 1085EAPI void
1062emotion_object_play_speed_set(Evas_Object *obj, double speed) 1086emotion_object_play_speed_set(Evas_Object *obj, double speed)
1063{ 1087{
1064 Smart_Data *sd; 1088 Emotion_Object_Data *sd;
1065 1089
1066 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1090 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1067 DBG("speed=%f", speed); 1091 DBG("speed=%f", speed);
@@ -1071,7 +1095,7 @@ emotion_object_play_speed_set(Evas_Object *obj, double speed)
1071EAPI double 1095EAPI double
1072emotion_object_play_speed_get(const Evas_Object *obj) 1096emotion_object_play_speed_get(const Evas_Object *obj)
1073{ 1097{
1074 Smart_Data *sd; 1098 Emotion_Object_Data *sd;
1075 1099
1076 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 1100 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
1077 return emotion_engine_instance_speed_get(sd->engine_instance); 1101 return emotion_engine_instance_speed_get(sd->engine_instance);
@@ -1080,7 +1104,7 @@ emotion_object_play_speed_get(const Evas_Object *obj)
1080EAPI void 1104EAPI void
1081emotion_object_eject(Evas_Object *obj) 1105emotion_object_eject(Evas_Object *obj)
1082{ 1106{
1083 Smart_Data *sd; 1107 Emotion_Object_Data *sd;
1084 1108
1085 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1109 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1086 emotion_engine_instance_eject(sd->engine_instance); 1110 emotion_engine_instance_eject(sd->engine_instance);
@@ -1089,7 +1113,7 @@ emotion_object_eject(Evas_Object *obj)
1089EAPI const char * 1113EAPI const char *
1090emotion_object_title_get(const Evas_Object *obj) 1114emotion_object_title_get(const Evas_Object *obj)
1091{ 1115{
1092 Smart_Data *sd; 1116 Emotion_Object_Data *sd;
1093 1117
1094 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1118 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1095 return sd->title; 1119 return sd->title;
@@ -1098,7 +1122,7 @@ emotion_object_title_get(const Evas_Object *obj)
1098EAPI const char * 1122EAPI const char *
1099emotion_object_progress_info_get(const Evas_Object *obj) 1123emotion_object_progress_info_get(const Evas_Object *obj)
1100{ 1124{
1101 Smart_Data *sd; 1125 Emotion_Object_Data *sd;
1102 1126
1103 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1127 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1104 return sd->progress.info; 1128 return sd->progress.info;
@@ -1107,16 +1131,19 @@ emotion_object_progress_info_get(const Evas_Object *obj)
1107EAPI double 1131EAPI double
1108emotion_object_progress_status_get(const Evas_Object *obj) 1132emotion_object_progress_status_get(const Evas_Object *obj)
1109{ 1133{
1110 Smart_Data *sd; 1134 return eo_do(obj, efl_player_progress_get());
1135}
1111 1136
1112 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 1137EOLIAN static double
1138_emotion_object_efl_player_progress_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
1139{
1113 return sd->progress.stat; 1140 return sd->progress.stat;
1114} 1141}
1115 1142
1116EAPI const char * 1143EAPI const char *
1117emotion_object_ref_file_get(const Evas_Object *obj) 1144emotion_object_ref_file_get(const Evas_Object *obj)
1118{ 1145{
1119 Smart_Data *sd; 1146 Emotion_Object_Data *sd;
1120 1147
1121 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1148 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1122 return sd->ref.file; 1149 return sd->ref.file;
@@ -1125,7 +1152,7 @@ emotion_object_ref_file_get(const Evas_Object *obj)
1125EAPI int 1152EAPI int
1126emotion_object_ref_num_get(const Evas_Object *obj) 1153emotion_object_ref_num_get(const Evas_Object *obj)
1127{ 1154{
1128 Smart_Data *sd; 1155 Emotion_Object_Data *sd;
1129 1156
1130 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1157 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1131 return sd->ref.num; 1158 return sd->ref.num;
@@ -1134,7 +1161,7 @@ emotion_object_ref_num_get(const Evas_Object *obj)
1134EAPI int 1161EAPI int
1135emotion_object_spu_button_count_get(const Evas_Object *obj) 1162emotion_object_spu_button_count_get(const Evas_Object *obj)
1136{ 1163{
1137 Smart_Data *sd; 1164 Emotion_Object_Data *sd;
1138 1165
1139 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1166 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1140 return sd->spu.button_num; 1167 return sd->spu.button_num;
@@ -1143,7 +1170,7 @@ emotion_object_spu_button_count_get(const Evas_Object *obj)
1143EAPI int 1170EAPI int
1144emotion_object_spu_button_get(const Evas_Object *obj) 1171emotion_object_spu_button_get(const Evas_Object *obj)
1145{ 1172{
1146 Smart_Data *sd; 1173 Emotion_Object_Data *sd;
1147 1174
1148 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1175 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1149 return sd->spu.button; 1176 return sd->spu.button;
@@ -1152,7 +1179,7 @@ emotion_object_spu_button_get(const Evas_Object *obj)
1152EAPI const char * 1179EAPI const char *
1153emotion_object_meta_info_get(const Evas_Object *obj, Emotion_Meta_Info meta) 1180emotion_object_meta_info_get(const Evas_Object *obj, Emotion_Meta_Info meta)
1154{ 1181{
1155 Smart_Data *sd; 1182 Emotion_Object_Data *sd;
1156 int id; 1183 int id;
1157 1184
1158 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1185 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
@@ -1190,7 +1217,7 @@ emotion_object_meta_info_get(const Evas_Object *obj, Emotion_Meta_Info meta)
1190EAPI void 1217EAPI void
1191emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization) 1218emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
1192{ 1219{
1193 Smart_Data *sd; 1220 Emotion_Object_Data *sd;
1194 1221
1195 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1222 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1196 DBG("visualization=%d", visualization); 1223 DBG("visualization=%d", visualization);
@@ -1200,7 +1227,7 @@ emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
1200EAPI Emotion_Vis 1227EAPI Emotion_Vis
1201emotion_object_vis_get(const Evas_Object *obj) 1228emotion_object_vis_get(const Evas_Object *obj)
1202{ 1229{
1203 Smart_Data *sd; 1230 Emotion_Object_Data *sd;
1204 1231
1205 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_VIS_NONE); 1232 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_VIS_NONE);
1206 return emotion_engine_instance_vis_get(sd->engine_instance); 1233 return emotion_engine_instance_vis_get(sd->engine_instance);
@@ -1209,7 +1236,7 @@ emotion_object_vis_get(const Evas_Object *obj)
1209EAPI Eina_Bool 1236EAPI Eina_Bool
1210emotion_object_vis_supported(const Evas_Object *obj, Emotion_Vis visualization) 1237emotion_object_vis_supported(const Evas_Object *obj, Emotion_Vis visualization)
1211{ 1238{
1212 Smart_Data *sd; 1239 Emotion_Object_Data *sd;
1213 1240
1214 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1241 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1215 return emotion_engine_instance_vis_supported(sd->engine_instance, visualization); 1242 return emotion_engine_instance_vis_supported(sd->engine_instance, visualization);
@@ -1218,7 +1245,7 @@ emotion_object_vis_supported(const Evas_Object *obj, Emotion_Vis visualization)
1218EAPI void 1245EAPI void
1219emotion_object_priority_set(Evas_Object *obj, Eina_Bool priority) 1246emotion_object_priority_set(Evas_Object *obj, Eina_Bool priority)
1220{ 1247{
1221 Smart_Data *sd; 1248 Emotion_Object_Data *sd;
1222 1249
1223 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1250 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1224 emotion_engine_instance_priority_set(sd->engine_instance, priority); 1251 emotion_engine_instance_priority_set(sd->engine_instance, priority);
@@ -1227,7 +1254,7 @@ emotion_object_priority_set(Evas_Object *obj, Eina_Bool priority)
1227EAPI Eina_Bool 1254EAPI Eina_Bool
1228emotion_object_priority_get(const Evas_Object *obj) 1255emotion_object_priority_get(const Evas_Object *obj)
1229{ 1256{
1230 Smart_Data *sd; 1257 Emotion_Object_Data *sd;
1231 1258
1232 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1259 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1233 return emotion_engine_instance_priority_get(sd->engine_instance); 1260 return emotion_engine_instance_priority_get(sd->engine_instance);
@@ -1235,7 +1262,7 @@ emotion_object_priority_get(const Evas_Object *obj)
1235 1262
1236#ifdef HAVE_EIO 1263#ifdef HAVE_EIO
1237static void 1264static void
1238_eio_load_xattr_cleanup(Smart_Data *sd, Eio_File *handler) 1265_eio_load_xattr_cleanup(Emotion_Object_Data *sd, Eio_File *handler)
1239{ 1266{
1240 if (handler == sd->load_xattr) sd->load_xattr = NULL; 1267 if (handler == sd->load_xattr) sd->load_xattr = NULL;
1241 1268
@@ -1250,7 +1277,7 @@ _eio_load_xattr_cleanup(Smart_Data *sd, Eio_File *handler)
1250static void 1277static void
1251_eio_load_xattr_done(void *data, Eio_File *handler, double xattr_double) 1278_eio_load_xattr_done(void *data, Eio_File *handler, double xattr_double)
1252{ 1279{
1253 Smart_Data *sd = data; 1280 Emotion_Object_Data *sd = data;
1254 1281
1255 emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double); 1282 emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double);
1256 evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_SUCCEED, NULL); 1283 evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_SUCCEED, NULL);
@@ -1260,7 +1287,7 @@ _eio_load_xattr_done(void *data, Eio_File *handler, double xattr_double)
1260static void 1287static void
1261_eio_load_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED) 1288_eio_load_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED)
1262{ 1289{
1263 Smart_Data *sd = data; 1290 Emotion_Object_Data *sd = data;
1264 1291
1265 evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_FAILED, NULL); 1292 evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_FAILED, NULL);
1266 _eio_load_xattr_cleanup(sd, handler); 1293 _eio_load_xattr_cleanup(sd, handler);
@@ -1270,7 +1297,7 @@ _eio_load_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED)
1270EAPI void 1297EAPI void
1271emotion_object_last_position_load(Evas_Object *obj) 1298emotion_object_last_position_load(Evas_Object *obj)
1272{ 1299{
1273 Smart_Data *sd; 1300 Emotion_Object_Data *sd;
1274 const char *tmp; 1301 const char *tmp;
1275#ifndef HAVE_EIO 1302#ifndef HAVE_EIO
1276 double xattr; 1303 double xattr;
@@ -1311,7 +1338,7 @@ emotion_object_last_position_load(Evas_Object *obj)
1311 1338
1312#ifdef HAVE_EIO 1339#ifdef HAVE_EIO
1313static void 1340static void
1314_eio_save_xattr_cleanup(Smart_Data *sd, Eio_File *handler) 1341_eio_save_xattr_cleanup(Emotion_Object_Data *sd, Eio_File *handler)
1315{ 1342{
1316 if (handler == sd->save_xattr) sd->save_xattr = NULL; 1343 if (handler == sd->save_xattr) sd->save_xattr = NULL;
1317 1344
@@ -1326,7 +1353,7 @@ _eio_save_xattr_cleanup(Smart_Data *sd, Eio_File *handler)
1326static void 1353static void
1327_eio_save_xattr_done(void *data, Eio_File *handler) 1354_eio_save_xattr_done(void *data, Eio_File *handler)
1328{ 1355{
1329 Smart_Data *sd = data; 1356 Emotion_Object_Data *sd = data;
1330 1357
1331 evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_SUCCEED, NULL); 1358 evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_SUCCEED, NULL);
1332 _eio_save_xattr_cleanup(sd, handler); 1359 _eio_save_xattr_cleanup(sd, handler);
@@ -1335,7 +1362,7 @@ _eio_save_xattr_done(void *data, Eio_File *handler)
1335static void 1362static void
1336_eio_save_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED) 1363_eio_save_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED)
1337{ 1364{
1338 Smart_Data *sd = data; 1365 Emotion_Object_Data *sd = data;
1339 1366
1340 evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_FAILED, NULL); 1367 evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_FAILED, NULL);
1341 _eio_save_xattr_cleanup(sd, handler); 1368 _eio_save_xattr_cleanup(sd, handler);
@@ -1345,7 +1372,7 @@ _eio_save_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED)
1345EAPI void 1372EAPI void
1346emotion_object_last_position_save(Evas_Object *obj) 1373emotion_object_last_position_save(Evas_Object *obj)
1347{ 1374{
1348 Smart_Data *sd; 1375 Emotion_Object_Data *sd;
1349 const char *tmp; 1376 const char *tmp;
1350 1377
1351 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1378 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -1381,7 +1408,7 @@ emotion_object_last_position_save(Evas_Object *obj)
1381EAPI void 1408EAPI void
1382emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state) 1409emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state)
1383{ 1410{
1384 Smart_Data *sd; 1411 Emotion_Object_Data *sd;
1385 1412
1386 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1413 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1387 switch (state) 1414 switch (state)
@@ -1404,7 +1431,7 @@ emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state)
1404EAPI Emotion_Suspend 1431EAPI Emotion_Suspend
1405emotion_object_suspend_get(Evas_Object *obj) 1432emotion_object_suspend_get(Evas_Object *obj)
1406{ 1433{
1407 Smart_Data *sd; 1434 Emotion_Object_Data *sd;
1408 1435
1409 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_WAKEUP); 1436 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_WAKEUP);
1410 return sd->state; 1437 return sd->state;
@@ -1417,7 +1444,7 @@ emotion_object_suspend_get(Evas_Object *obj)
1417EAPI void * 1444EAPI void *
1418_emotion_video_get(const Evas_Object *obj) 1445_emotion_video_get(const Evas_Object *obj)
1419{ 1446{
1420 Smart_Data *sd; 1447 Emotion_Object_Data *sd;
1421 1448
1422 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1449 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1423 return emotion_engine_instance_data_get(sd->engine_instance); 1450 return emotion_engine_instance_data_get(sd->engine_instance);
@@ -1427,7 +1454,7 @@ static Eina_Bool
1427_emotion_frame_anim(void *data) 1454_emotion_frame_anim(void *data)
1428{ 1455{
1429 Evas_Object *obj = data; 1456 Evas_Object *obj = data;
1430 Smart_Data *sd; 1457 Emotion_Object_Data *sd;
1431 1458
1432 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EINA_FALSE); 1459 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EINA_FALSE);
1433 1460
@@ -1441,7 +1468,7 @@ _emotion_frame_anim(void *data)
1441EAPI void 1468EAPI void
1442_emotion_frame_new(Evas_Object *obj) 1469_emotion_frame_new(Evas_Object *obj)
1443{ 1470{
1444 Smart_Data *sd; 1471 Emotion_Object_Data *sd;
1445 1472
1446 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1473 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1447 1474
@@ -1451,7 +1478,7 @@ _emotion_frame_new(Evas_Object *obj)
1451EAPI void 1478EAPI void
1452_emotion_video_pos_update(Evas_Object *obj, double pos, double len) 1479_emotion_video_pos_update(Evas_Object *obj, double pos, double len)
1453{ 1480{
1454 Smart_Data *sd; 1481 Emotion_Object_Data *sd;
1455 int npos = 0, nlen = 0; 1482 int npos = 0, nlen = 0;
1456 1483
1457 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1484 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -1466,7 +1493,7 @@ _emotion_video_pos_update(Evas_Object *obj, double pos, double len)
1466EAPI void 1493EAPI void
1467_emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio) 1494_emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
1468{ 1495{
1469 Smart_Data *sd; 1496 Emotion_Object_Data *sd;
1470 double tmp; 1497 double tmp;
1471 int changed = 0; 1498 int changed = 0;
1472 1499
@@ -1498,7 +1525,7 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
1498EAPI void 1525EAPI void
1499_emotion_image_reset(Evas_Object *obj) 1526_emotion_image_reset(Evas_Object *obj)
1500{ 1527{
1501 Smart_Data *sd; 1528 Emotion_Object_Data *sd;
1502 1529
1503 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1530 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1504 _emotion_image_data_zero(sd->obj); 1531 _emotion_image_data_zero(sd->obj);
@@ -1507,7 +1534,7 @@ _emotion_image_reset(Evas_Object *obj)
1507EAPI void 1534EAPI void
1508_emotion_decode_stop(Evas_Object *obj) 1535_emotion_decode_stop(Evas_Object *obj)
1509{ 1536{
1510 Smart_Data *sd; 1537 Emotion_Object_Data *sd;
1511 1538
1512 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1539 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1513 if (sd->play) 1540 if (sd->play)
@@ -1520,7 +1547,7 @@ _emotion_decode_stop(Evas_Object *obj)
1520EAPI void 1547EAPI void
1521_emotion_open_done(Evas_Object *obj) 1548_emotion_open_done(Evas_Object *obj)
1522{ 1549{
1523 Smart_Data *sd; 1550 Emotion_Object_Data *sd;
1524 1551
1525 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1552 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1526 sd->open = 1; 1553 sd->open = 1;
@@ -1553,7 +1580,7 @@ _emotion_audio_level_change(Evas_Object *obj)
1553EAPI void 1580EAPI void
1554_emotion_channels_change(Evas_Object *obj) 1581_emotion_channels_change(Evas_Object *obj)
1555{ 1582{
1556 Smart_Data *sd; 1583 Emotion_Object_Data *sd;
1557 1584
1558 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1585 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1559 evas_object_smart_callback_call(obj, SIG_CHANNELS_CHANGE, NULL); 1586 evas_object_smart_callback_call(obj, SIG_CHANNELS_CHANGE, NULL);
@@ -1562,7 +1589,7 @@ _emotion_channels_change(Evas_Object *obj)
1562EAPI void 1589EAPI void
1563_emotion_title_set(Evas_Object *obj, char *title) 1590_emotion_title_set(Evas_Object *obj, char *title)
1564{ 1591{
1565 Smart_Data *sd; 1592 Emotion_Object_Data *sd;
1566 1593
1567 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1594 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1568 eina_stringshare_replace(&sd->title, title); 1595 eina_stringshare_replace(&sd->title, title);
@@ -1572,7 +1599,7 @@ _emotion_title_set(Evas_Object *obj, char *title)
1572EAPI void 1599EAPI void
1573_emotion_progress_set(Evas_Object *obj, char *info, double st) 1600_emotion_progress_set(Evas_Object *obj, char *info, double st)
1574{ 1601{
1575 Smart_Data *sd; 1602 Emotion_Object_Data *sd;
1576 1603
1577 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1604 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1578 eina_stringshare_replace(&sd->progress.info, info); 1605 eina_stringshare_replace(&sd->progress.info, info);
@@ -1583,7 +1610,7 @@ _emotion_progress_set(Evas_Object *obj, char *info, double st)
1583EAPI void 1610EAPI void
1584_emotion_file_ref_set(Evas_Object *obj, const char *file, int num) 1611_emotion_file_ref_set(Evas_Object *obj, const char *file, int num)
1585{ 1612{
1586 Smart_Data *sd; 1613 Emotion_Object_Data *sd;
1587 1614
1588 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1615 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1589 eina_stringshare_replace(&sd->ref.file, file); 1616 eina_stringshare_replace(&sd->ref.file, file);
@@ -1594,7 +1621,7 @@ _emotion_file_ref_set(Evas_Object *obj, const char *file, int num)
1594EAPI void 1621EAPI void
1595_emotion_spu_button_num_set(Evas_Object *obj, int num) 1622_emotion_spu_button_num_set(Evas_Object *obj, int num)
1596{ 1623{
1597 Smart_Data *sd; 1624 Emotion_Object_Data *sd;
1598 1625
1599 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1626 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1600 sd->spu.button_num = num; 1627 sd->spu.button_num = num;
@@ -1604,7 +1631,7 @@ _emotion_spu_button_num_set(Evas_Object *obj, int num)
1604EAPI void 1631EAPI void
1605_emotion_spu_button_set(Evas_Object *obj, int button) 1632_emotion_spu_button_set(Evas_Object *obj, int button)
1606{ 1633{
1607 Smart_Data *sd; 1634 Emotion_Object_Data *sd;
1608 1635
1609 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1636 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1610 sd->spu.button = button; 1637 sd->spu.button = button;
@@ -1614,7 +1641,7 @@ _emotion_spu_button_set(Evas_Object *obj, int button)
1614EAPI void 1641EAPI void
1615_emotion_seek_done(Evas_Object *obj) 1642_emotion_seek_done(Evas_Object *obj)
1616{ 1643{
1617 Smart_Data *sd; 1644 Emotion_Object_Data *sd;
1618 1645
1619 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1646 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1620 if (sd->seeking) 1647 if (sd->seeking)
@@ -1627,7 +1654,7 @@ _emotion_seek_done(Evas_Object *obj)
1627EAPI void 1654EAPI void
1628_emotion_frame_refill(Evas_Object *obj, double w, double h) 1655_emotion_frame_refill(Evas_Object *obj, double w, double h)
1629{ 1656{
1630 Smart_Data *sd; 1657 Emotion_Object_Data *sd;
1631 1658
1632 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1659 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1633 if (sd->fill.w != w || sd->fill.h != h) 1660 if (sd->fill.w != w || sd->fill.h != h)
@@ -1665,7 +1692,7 @@ static void
1665_mouse_move(void *data, Evas *ev EINA_UNUSED, Evas_Object *obj, void *event_info) 1692_mouse_move(void *data, Evas *ev EINA_UNUSED, Evas_Object *obj, void *event_info)
1666{ 1693{
1667 Evas_Event_Mouse_Move *e; 1694 Evas_Event_Mouse_Move *e;
1668 Smart_Data *sd; 1695 Emotion_Object_Data *sd;
1669 int x, y, iw, ih; 1696 int x, y, iw, ih;
1670 Evas_Coord ox, oy, ow, oh; 1697 Evas_Coord ox, oy, ow, oh;
1671 1698
@@ -1683,7 +1710,7 @@ static void
1683_mouse_down(void *data, Evas *ev EINA_UNUSED, Evas_Object *obj, void *event_info) 1710_mouse_down(void *data, Evas *ev EINA_UNUSED, Evas_Object *obj, void *event_info)
1684{ 1711{
1685 Evas_Event_Mouse_Down *e; 1712 Evas_Event_Mouse_Down *e;
1686 Smart_Data *sd; 1713 Emotion_Object_Data *sd;
1687 int x, y, iw, ih; 1714 int x, y, iw, ih;
1688 Evas_Coord ox, oy, ow, oh; 1715 Evas_Coord ox, oy, ow, oh;
1689 1716
@@ -1701,7 +1728,7 @@ static void
1701_pos_set_job(void *data) 1728_pos_set_job(void *data)
1702{ 1729{
1703 Evas_Object *obj; 1730 Evas_Object *obj;
1704 Smart_Data *sd; 1731 Emotion_Object_Data *sd;
1705 1732
1706 obj = data; 1733 obj = data;
1707 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1734 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -1720,7 +1747,7 @@ static void
1720_pixels_get(void *data, Evas_Object *obj) 1747_pixels_get(void *data, Evas_Object *obj)
1721{ 1748{
1722 int iw, ih, w, h; 1749 int iw, ih, w, h;
1723 Smart_Data *sd; 1750 Emotion_Object_Data *sd;
1724 Emotion_Format format; 1751 Emotion_Format format;
1725 unsigned char *bgra_data; 1752 unsigned char *bgra_data;
1726 1753
@@ -1776,39 +1803,11 @@ _pixels_get(void *data, Evas_Object *obj)
1776/* Internal smart object required routines */ 1803/* Internal smart object required routines */
1777/*******************************************/ 1804/*******************************************/
1778 1805
1779static void 1806EOLIAN static void
1780_smart_init(void) 1807_emotion_object_evas_object_smart_add(Evas_Object *obj, Emotion_Object_Data *sd)
1781{
1782 static Evas_Smart_Class sc =
1783 EVAS_SMART_CLASS_INIT_NAME_VERSION(E_OBJ_NAME);
1784
1785 if (smart) return;
1786
1787 if (!sc.add)
1788 {
1789 sc.add = _smart_add;
1790 sc.del = _smart_del;
1791 sc.move = _smart_move;
1792 sc.resize = _smart_resize;
1793 sc.show = _smart_show;
1794 sc.hide = _smart_hide;
1795 sc.color_set = _smart_color_set;
1796 sc.clip_set = _smart_clip_set;
1797 sc.clip_unset = _smart_clip_unset;
1798 sc.callbacks = _smart_callbacks;
1799 }
1800 smart = evas_smart_class_new(&sc);
1801}
1802
1803static void
1804_smart_add(Evas_Object * obj)
1805{ 1808{
1806 Smart_Data *sd;
1807 unsigned int *pixel; 1809 unsigned int *pixel;
1808 1810
1809 sd = calloc(1, sizeof(Smart_Data));
1810 if (!sd) return;
1811
1812 /* TODO: remove legacy: emotion used to have no init, call automatically */ 1811 /* TODO: remove legacy: emotion used to have no init, call automatically */
1813 emotion_init(); 1812 emotion_init();
1814 1813
@@ -1838,12 +1837,9 @@ _smart_add(Evas_Object * obj)
1838 evas_object_smart_data_set(obj, sd); 1837 evas_object_smart_data_set(obj, sd);
1839} 1838}
1840 1839
1841static void 1840EOLIAN static void
1842_smart_del(Evas_Object * obj) 1841_emotion_object_evas_object_smart_del(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd)
1843{ 1842{
1844 Smart_Data *sd;
1845
1846 sd = evas_object_smart_data_get(obj);
1847 if (!sd) return; 1843 if (!sd) return;
1848 if (sd->engine_instance) 1844 if (sd->engine_instance)
1849 { 1845 {
@@ -1873,40 +1869,28 @@ _smart_del(Evas_Object * obj)
1873 _smart_data_free(sd); 1869 _smart_data_free(sd);
1874} 1870}
1875 1871
1876static void 1872EOLIAN static void
1877_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y) 1873_emotion_object_evas_object_smart_move(Evas_Object *obj, Emotion_Object_Data *sd, Evas_Coord x, Evas_Coord y)
1878{ 1874{
1879 Smart_Data *sd;
1880 int w, h; 1875 int w, h;
1881 1876
1882 sd = evas_object_smart_data_get(obj);
1883 if (!sd) return;
1884
1885 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 1877 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1886 _clipper_position_size_update(obj, x, y, w, h, sd->video.w, sd->video.h); 1878 _clipper_position_size_update(obj, x, y, w, h, sd->video.w, sd->video.h);
1887 evas_object_move(sd->bg, x, y); 1879 evas_object_move(sd->bg, x, y);
1888} 1880}
1889 1881
1890static void 1882EOLIAN static void
1891_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h) 1883_emotion_object_evas_object_smart_resize(Evas_Object *obj, Emotion_Object_Data *sd, Evas_Coord w, Evas_Coord h)
1892{ 1884{
1893 Smart_Data *sd;
1894
1895 sd = evas_object_smart_data_get(obj);
1896 if (!sd) return;
1897
1898 _emotion_object_aspect_border_apply(obj, sd, w, h); 1885 _emotion_object_aspect_border_apply(obj, sd, w, h);
1899 evas_object_resize(sd->bg, w, h); 1886 evas_object_resize(sd->bg, w, h);
1900} 1887}
1901 1888
1902static void 1889EOLIAN static void
1903_smart_show(Evas_Object * obj) 1890_emotion_object_evas_object_smart_show(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd)
1904{ 1891{
1905 Smart_Data *sd;
1906 int a; 1892 int a;
1907 1893
1908 sd = evas_object_smart_data_get(obj);
1909 if (!sd) return;
1910 evas_object_show(sd->obj); 1894 evas_object_show(sd->obj);
1911 if (sd->crop.clipper) 1895 if (sd->crop.clipper)
1912 evas_object_show(sd->crop.clipper); 1896 evas_object_show(sd->crop.clipper);
@@ -1916,37 +1900,25 @@ _smart_show(Evas_Object * obj)
1916 evas_object_show(sd->bg); 1900 evas_object_show(sd->bg);
1917} 1901}
1918 1902
1919static void 1903EOLIAN static void
1920_smart_hide(Evas_Object * obj) 1904_emotion_object_evas_object_smart_hide(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd)
1921{ 1905{
1922 Smart_Data *sd;
1923
1924 sd = evas_object_smart_data_get(obj);
1925 if (!sd) return;
1926 evas_object_hide(sd->obj); 1906 evas_object_hide(sd->obj);
1927 if (sd->crop.clipper) 1907 if (sd->crop.clipper)
1928 evas_object_hide(sd->crop.clipper); 1908 evas_object_hide(sd->crop.clipper);
1929 evas_object_hide(sd->bg); 1909 evas_object_hide(sd->bg);
1930} 1910}
1931 1911
1932static void 1912EOLIAN static void
1933_smart_color_set(Evas_Object * obj, int r, int g, int b, int a) 1913_emotion_object_evas_object_smart_color_set(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd, int r, int g, int b, int a)
1934{ 1914{
1935 Smart_Data *sd;
1936
1937 sd = evas_object_smart_data_get(obj);
1938 if (!sd) return;
1939 evas_object_color_set(sd->obj, r, g, b, a); 1915 evas_object_color_set(sd->obj, r, g, b, a);
1940 evas_object_color_set(sd->crop.clipper, r, g, b, a); 1916 evas_object_color_set(sd->crop.clipper, r, g, b, a);
1941} 1917}
1942 1918
1943static void 1919EOLIAN static void
1944_smart_clip_set(Evas_Object * obj, Evas_Object * clip) 1920_emotion_object_evas_object_smart_clip_set(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd, Evas_Object * clip)
1945{ 1921{
1946 Smart_Data *sd;
1947
1948 sd = evas_object_smart_data_get(obj);
1949 if (!sd) return;
1950 if (sd->crop.clipper) 1922 if (sd->crop.clipper)
1951 evas_object_clip_set(sd->crop.clipper, clip); 1923 evas_object_clip_set(sd->crop.clipper, clip);
1952 else 1924 else
@@ -1954,13 +1926,9 @@ _smart_clip_set(Evas_Object * obj, Evas_Object * clip)
1954 evas_object_clip_set(sd->bg, clip); 1926 evas_object_clip_set(sd->bg, clip);
1955} 1927}
1956 1928
1957static void 1929EOLIAN static void
1958_smart_clip_unset(Evas_Object * obj) 1930_emotion_object_evas_object_smart_clip_unset(Evas_Object *obj EINA_UNUSED, Emotion_Object_Data *sd)
1959{ 1931{
1960 Smart_Data *sd;
1961
1962 sd = evas_object_smart_data_get(obj);
1963 if (!sd) return;
1964 if (sd->crop.clipper) 1932 if (sd->crop.clipper)
1965 evas_object_clip_unset(sd->crop.clipper); 1933 evas_object_clip_unset(sd->crop.clipper);
1966 else 1934 else
@@ -1968,4 +1936,4 @@ _smart_clip_unset(Evas_Object * obj)
1968 evas_object_clip_unset(sd->bg); 1936 evas_object_clip_unset(sd->bg);
1969} 1937}
1970 1938
1971#include "emotion_object.eo.h" 1939#include "emotion_object.eo.c"