From: Tom Hacohen Date: Tue, 22 Jul 2014 14:44:52 +0000 (+0100) Subject: Bg: Use file interface X-Git-Tag: upstream/1.11.0+18+ga65bbf6~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad1bc2cdf7304e0a3e3483f192b4b65a60ce3283;p=platform%2Fupstream%2Felementary.git Bg: Use file interface --- diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index d746f4b..bc71baf 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -143,7 +143,7 @@ _elm_bg_eo_base_constructor(Eo *obj, Elm_Bg_Data *_pd EINA_UNUSED) } EOLIAN static Eina_Bool -_elm_bg_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group) +_elm_bg_efl_file_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -197,7 +197,7 @@ _elm_bg_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group) } EOLIAN static void -_elm_bg_file_get(Eo *obj EINA_UNUSED, Elm_Bg_Data *sd, const char **file, const char **group) +_elm_bg_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Bg_Data *sd, const char **file, const char **group) { if (file) *file = sd->file; if (group) *group = sd->group; @@ -287,4 +287,16 @@ _elm_bg_class_constructor(Eo_Class *klass) evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } +EAPI Eina_Bool +elm_bg_file_set(Eo *obj, const char *file, const char *group) +{ + return eo_do((Eo *) obj, efl_file_set(file, group)); +} + +EAPI void +elm_bg_file_get(const Eo *obj, const char **file, const char **group) +{ + eo_do((Eo *) obj, efl_file_get(file, group)); +} + #include "elm_bg.eo.c" diff --git a/src/lib/elm_bg.eo b/src/lib/elm_bg.eo index 20c7e9b..0ba1e5e 100644 --- a/src/lib/elm_bg.eo +++ b/src/lib/elm_bg.eo @@ -1,4 +1,4 @@ -class Elm_Bg (Elm_Layout) +class Elm_Bg (Elm_Layout, Efl.File) { eo_prefix: elm_obj_bg; properties { @@ -69,48 +69,6 @@ class Elm_Bg (Elm_Layout) int a; /*@ The blue color component's value */ } } - file { - set { - /*@ - Set the file (image or edje collection) to give life for the - background - - @return @c EINA_TRUE on success, @c EINA_FALSE otherwise - - This sets the image file used in the background object. If the - image comes from an Edje group, it will be stretched to completely - fill the background object. If it comes from a traditional image file, it - will by default be centered in this widget's are (thus retaining - its aspect), what could lead to some parts being not visible. You - may change the mode of exhibition for a real image file with - elm_bg_option_set(). - - @note Once the image of @p obj is set, a previously set one will be - deleted, even if @p file is @c NULL. - - @note This will only affect the contents of one of the background's - swallow spots, namely @c "elm.swallow.background". If you want to - achieve the @c Layout's file setting behavior, you'll have to call - that method on this object. - - @ingroup Bg */ - return: bool; - } - get { - /*@ - Get the file (image or edje collection) set on a given background - widget - - @note Use @c NULL pointers on the file components you're not - interested in: they'll be ignored by the function. - - @ingroup Bg */ - } - values { - const(char)* file; /*@ The file path */ - const(char)* group; /*@ Optional key (group in Edje) within the file */ - } - } load_size { set { /*@ @@ -144,6 +102,8 @@ class Elm_Bg (Elm_Layout) Evas.Object_Smart.add; Elm_Layout.content_aliases.get; Elm_Layout.sizing_eval; + Efl.File.file.set; + Efl.File.file.get; } } diff --git a/src/lib/elm_bg_legacy.h b/src/lib/elm_bg_legacy.h index 6f1ccc3..612624c 100644 --- a/src/lib/elm_bg_legacy.h +++ b/src/lib/elm_bg_legacy.h @@ -48,4 +48,49 @@ EAPI void elm_bg_color_set(Evas_Object *obj, int r, int */ EAPI void elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b); -#include "elm_bg.eo.legacy.h" \ No newline at end of file +/** + * + * Set the file (image or edje collection) to give life for the + * background + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise + * + * This sets the image file used in the background object. If the + * image comes from an Edje group, it will be stretched to completely + * fill the background object. If it comes from a traditional image file, it + * will by default be centered in this widget's are (thus retaining + * its aspect), what could lead to some parts being not visible. You + * may change the mode of exhibition for a real image file with + * elm_bg_option_set(). + * + * @note Once the image of @p obj is set, a previously set one will be + * deleted, even if @p file is @c NULL. + * + * @note This will only affect the contents of one of the background's + * swallow spots, namely @c "elm.swallow.background". If you want to + * achieve the @c Layout's file setting behavior, you'll have to call + * that method on this object. + * + * @ingroup Bg + * + * @param[in] file The file path + * @param[in] group Optional key (group in Edje) within the file + */ +EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group); + +/** + * + * Get the file (image or edje collection) set on a given background + * widget + * + * @note Use @c NULL pointers on the file components you're not + * interested in: they'll be ignored by the function. + * + * @ingroup Bg + * + * @param[out] file The file path + * @param[out] group Optional key (group in Edje) within the file + */ +EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group); + +#include "elm_bg.eo.legacy.h"