From: Tom Hacohen Date: Tue, 22 Jul 2014 15:20:31 +0000 (+0100) Subject: Photo: Use file interface. X-Git-Tag: upstream/1.11.0+18+ga65bbf6~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64810176aac12ca84f69dcaf644355ea5fb6eab6;p=platform%2Fupstream%2Felementary.git Photo: Use file interface. --- diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index ba0ee5b..2bf5838 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -324,7 +324,7 @@ _elm_photo_eo_base_constructor(Eo *obj, Elm_Photo_Data *_pd EINA_UNUSED) } EOLIAN static Eina_Bool -_elm_photo_file_set(Eo *obj, Elm_Photo_Data *sd, const char *file) +_elm_photo_efl_file_file_set(Eo *obj, Elm_Photo_Data *sd, const char *file, const char *key EINA_UNUSED) { if (!file) { @@ -410,4 +410,10 @@ _elm_photo_class_constructor(Eo_Class *klass) evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } +EAPI Eina_Bool +elm_photo_file_set(Eo *obj, const char *file) +{ + return eo_do((Eo *) obj, efl_file_set(file, NULL)); +} + #include "elm_photo.eo.c" diff --git a/src/lib/elm_photo.eo b/src/lib/elm_photo.eo index ba414d7..1847cb5 100644 --- a/src/lib/elm_photo.eo +++ b/src/lib/elm_photo.eo @@ -1,4 +1,4 @@ -class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface) +class Elm_Photo (Elm_Widget, Efl.File, Evas.Clickable_Interface, Evas.Draggable_Interface) { eo_prefix: elm_obj_photo; properties { @@ -74,23 +74,6 @@ class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface) int size; /*@ The size of the photo */ } } - file { - set { - /*@ - Set the file that will be used as the photo widget's image. - - @return @c EINA_TRUE on success, @c EINA_FALSE otherwise - - @note Use @c NULL on @a file to set the photo widget back to it's - initial state, which indicates "no photo". - - @ingroup Photo */ - return: bool; - } - values { - const(char)* file; /*@ The path to file that will be used as @a obj's image. */ - } - } } methods { thumb_set @const { @@ -107,6 +90,7 @@ class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface) implements { class.constructor; Eo.Base.constructor; + Efl.File.file.set; Evas.Object_Smart.add; Evas.Object_Smart.del; Elm_Widget.theme_apply; diff --git a/src/lib/elm_photo_legacy.h b/src/lib/elm_photo_legacy.h index 0c07d8a..8534268 100644 --- a/src/lib/elm_photo_legacy.h +++ b/src/lib/elm_photo_legacy.h @@ -8,4 +8,19 @@ */ EAPI Evas_Object *elm_photo_add(Evas_Object *parent); -#include "elm_photo.eo.legacy.h" \ No newline at end of file +/** + * + * Set the file that will be used as the photo widget's image. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise + * + * @note Use @c NULL on @a file to set the photo widget back to it's + * initial state, which indicates "no photo". + * + * @ingroup Photo + * + * @param[in] file The path to file that will be used as @a obj's image. + */ +EAPI Eina_Bool elm_photo_file_set(Eo *obj, const char *file); + +#include "elm_photo.eo.legacy.h"