From e8b6d05d3399f32fdef19d9a9dc1560adbced2fb Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 22 Jul 2014 16:25:39 +0100 Subject: [PATCH] Thumb: Use file interface. --- src/lib/elm_thumb.c | 21 ++++++++++++++++++--- src/lib/elm_thumb.eo | 33 +++------------------------------ src/lib/elm_thumb_legacy.h | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c index d6d7d04..7bee347 100644 --- a/src/lib/elm_thumb.c +++ b/src/lib/elm_thumb.c @@ -614,8 +614,8 @@ _elm_thumb_reload(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd) _thumb_show(sd); } -EOLIAN static void -_elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key) +EOLIAN static Eina_Bool +_elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key) { Eina_Bool file_replaced, key_replaced; @@ -651,10 +651,12 @@ _elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, c if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj))) _thumb_show(sd); + + return EINA_TRUE; } EOLIAN static void -_elm_thumb_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key) +_elm_thumb_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key) { if (file) *file = sd->file; @@ -848,4 +850,17 @@ _elm_thumb_class_constructor(Eo_Class *klass) evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } +EAPI void +elm_thumb_file_set(Eo *obj, const char *file, const char *key) +{ + eo_do((Eo *) obj, efl_file_set(file, key)); +} + +EAPI void +elm_thumb_file_get(const Eo *obj, const char **file, const char **key) +{ + eo_do((Eo *) obj, efl_file_get(file, key)); +} + + #include "elm_thumb.eo.c" diff --git a/src/lib/elm_thumb.eo b/src/lib/elm_thumb.eo index c7b230d..e863f894 100644 --- a/src/lib/elm_thumb.eo +++ b/src/lib/elm_thumb.eo @@ -1,4 +1,4 @@ -class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface) +class Elm_Thumb (Elm_Layout, Efl.File, Evas.Clickable_Interface) { eo_prefix: elm_obj_thumb; properties { @@ -104,35 +104,6 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface) Ethumb_Thumb_FDO_Size size; /*@ The FDO size setting. */ } } - file { - set { - /*@ - Set the file that will be used as thumbnail @b source. - - The file can be an image or a video (in that case, acceptable - extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the - video animation, use the function elm_thumb_animate(). - - @see elm_thumb_file_get() - @see elm_thumb_reload() - @see elm_thumb_animate() - - @ingroup Thumb */ - } - get { - /*@ - Get the image or video path and key used to generate the thumbnail. - - @see elm_thumb_file_set() - @see elm_thumb_path_get() - - @ingroup Thumb */ - } - values { - const(char)* file; /*@ The path to file that will be used as thumbnail source. */ - const(char)* key; /*@ The key used in case of an EET file. */ - } - } orientation { set { /*@ @@ -331,6 +302,8 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface) implements { class.constructor; Eo.Base.constructor; + Efl.File.file.set; + Efl.File.file.get; Evas.Object_Smart.hide; Evas.Object_Smart.add; Evas.Object_Smart.del; diff --git a/src/lib/elm_thumb_legacy.h b/src/lib/elm_thumb_legacy.h index 313c805..bd68b28 100644 --- a/src/lib/elm_thumb_legacy.h +++ b/src/lib/elm_thumb_legacy.h @@ -11,4 +11,37 @@ */ EAPI Evas_Object *elm_thumb_add(Evas_Object *parent); -#include "elm_thumb.eo.legacy.h" \ No newline at end of file +/** + * + * Set the file that will be used as thumbnail @b source. + * + * The file can be an image or a video (in that case, acceptable + * extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the + * video animation, use the function elm_thumb_animate(). + * + * @see elm_thumb_file_get() + * @see elm_thumb_reload() + * @see elm_thumb_animate() + * + * @ingroup Thumb + * + * @param[in] file The path to file that will be used as thumbnail source. + * @param[in] key The key used in case of an EET file. + */ +EAPI void elm_thumb_file_set(Eo *obj, const char *file, const char *key); + +/** + * + * Get the image or video path and key used to generate the thumbnail. + * + * @see elm_thumb_file_set() + * @see elm_thumb_path_get() + * + * @ingroup Thumb + * + * @param[out] file The path to file that will be used as thumbnail source. + * @param[out] key The key used in case of an EET file. + */ +EAPI void elm_thumb_file_get(const Eo *obj, const char **file, const char **key); + +#include "elm_thumb.eo.legacy.h" -- 2.7.4