From 0f3ccbfd172ca6746910a00cb4e598a971d89d81 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 6 Aug 2014 11:56:01 +0100 Subject: [PATCH] Emotion object: Create .eo file. --- src/Makefile_Emotion.am | 15 +++++ src/lib/emotion/Emotion.h | 2 + src/lib/emotion/emotion_object.eo | 91 +++++++++++++++++++++++++++++++ src/lib/emotion/emotion_smart.c | 1 + 4 files changed, 109 insertions(+) create mode 100644 src/lib/emotion/emotion_object.eo diff --git a/src/Makefile_Emotion.am b/src/Makefile_Emotion.am index d295bfeb88..b8f424dd7a 100644 --- a/src/Makefile_Emotion.am +++ b/src/Makefile_Emotion.am @@ -1,11 +1,26 @@ ### Library +BUILT_SOURCES += \ + lib/emotion/emotion_object.eo.c \ + lib/emotion/emotion_object.eo.h \ + lib/emotion/emotion_object.eo.legacy.h + +emotioneolianfilesdir = $(datadir)/eolian/include/emotion-@VMAJ@ +emotioneolianfiles_DATA = \ + lib/emotion/emotion_object.eo + +EXTRA_DIST += \ + ${emotioneolianfiles_DATA} + lib_LTLIBRARIES += \ lib/emotion/libemotion.la installed_emotionmainheadersdir = $(includedir)/emotion-@VMAJ@ dist_installed_emotionmainheaders_DATA = lib/emotion/Emotion.h +nodist_installed_emotionmainheaders_DATA = \ + lib/emotion/emotion_object.eo.h + # libemotion.la lib_emotion_libemotion_la_SOURCES = \ lib/emotion/emotion_modules.h \ diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h index 7240d2f251..f11cbc71ec 100644 --- a/src/lib/emotion/Emotion.h +++ b/src/lib/emotion/Emotion.h @@ -360,6 +360,8 @@ extern "C" { EAPI Eina_Bool emotion_init(void); EAPI Eina_Bool emotion_shutdown(void); +#include "emotion_object.eo.h" + /** * @brief Add an emotion object to the canvas. * diff --git a/src/lib/emotion/emotion_object.eo b/src/lib/emotion/emotion_object.eo new file mode 100644 index 0000000000..92e1b25c51 --- /dev/null +++ b/src/lib/emotion/emotion_object.eo @@ -0,0 +1,91 @@ +class Emotion.Object (Efl.File, Efl.Player, Efl.Image) { + eo_prefix: emotion_obj; + properties { + option { + set { + /** + * @brief Set the specified option for the current module. + * + * This function allows one to mute the video or audio of the emotion object. + * + * @note Please don't use this function, consider using + * emotion_object_audio_mute_set() and emotion_object_video_mute_set() instead. + * + * @see emotion_object_audio_mute_set() + * @see emotion_object_video_mute_set() + * + * @ingroup Emotion_Init + */ + legacy emotion_object_module_option_set; + } + values { + const(char) *opt; /*@ The option that is being set. Currently supported optiosn: "video" and "audio". */ + const(char) *val; /*@ The value of the option. Currently only supports "off" (?!?!?!) */ + } + } + engine { + set { + /** + * @brief Initializes an emotion object with the specified module. + * + * This function is required after creating the emotion object, in order to + * specify which module will be used with this object. Different objects can + * use different modules to play a media file. The current supported modules are + * @b gstreamer and @b xine. + * + * To use any of them, you need to make sure that support for them was compiled + * correctly. + * + * @note It's possible to disable the build of a module with + * --disable-module_name. + * + * @see emotion_object_add() + * @see emotion_object_file_set() + * + * @ingroup Emotion_Init + */ + legacy emotion_object_init; + return bool; /*@ @c EINA_TRUE if the specified module was successfully initialized for this object, @c EINA_FALSE otherwise. */ + } + values { + const(char) *module_filename; /*@ The name of the module to be used (gstreamer or xine). */ + } + } + } + implements { + Efl.File.file.set; + Efl.File.file.get; + Efl.Player.play.set; + Efl.Player.play.get; + Efl.Player.position.set; + Efl.Player.position.get; + Efl.Player.progress.get; + Efl.Player.audio_volume.set; + Efl.Player.audio_volume.get; + Efl.Player.audio_mute.set; + Efl.Player.audio_mute.get; + Efl.Image.load_size.get; + Efl.Image.ratio.get; + Efl.Image.smooth_scale.set; + Efl.Image.smooth_scale.get; + } +} + +/* FIXME: Need to be added: +EAPI double emotion_object_buffer_size_get (const Evas_Object *obj); +EAPI Eina_Bool emotion_object_seekable_get (const Evas_Object *obj); +EAPI double emotion_object_play_length_get (const Evas_Object *obj); +EAPI const char *emotion_object_progress_info_get (const Evas_Object *obj); +EAPI Eina_Bool emotion_object_video_handled_get (const Evas_Object *obj); +EAPI Eina_Bool emotion_object_audio_handled_get (const Evas_Object *obj); + +Everything starting from (needs to be added): +EAPI int emotion_object_audio_channel_count (const Evas_Object *obj); + +Should this be part of player or emotion object? +EAPI void emotion_object_event_simple_send (Evas_Object *obj, Emotion_Event ev); + +Deliberations: +Should this really implement the image interface? +*/ + diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index ed19ce4a77..dc809d77a9 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -1968,3 +1968,4 @@ _smart_clip_unset(Evas_Object * obj) evas_object_clip_unset(sd->bg); } +#include "emotion_object.eo.h"