From 5be49ace8ffb2f7353a5213368c284f7da0781d1 Mon Sep 17 00:00:00 2001 From: Ji-Youn Park Date: Fri, 1 Apr 2016 14:14:21 +0830 Subject: [PATCH] Elm_image: remove elm_image_fill_outside_get This api will be removed. elm_image_fill_outside_get is same as !elm_image_fill_inside_get. elm_image_fill_outside_set function is too. --- src/lib/elementary/elm_image.c | 34 +++++++++++++++----------- src/lib/elementary/elm_image.eo | 23 +----------------- src/lib/elementary/elm_image_legacy.h | 45 +++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 36 deletions(-) diff --git a/src/lib/elementary/elm_image.c b/src/lib/elementary/elm_image.c index e5b533e..7ae9e46 100644 --- a/src/lib/elementary/elm_image.c +++ b/src/lib/elementary/elm_image.c @@ -1231,20 +1231,6 @@ _elm_image_resizable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool *siz } EOLIAN static void -_elm_image_fill_outside_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool fill_outside) -{ - sd->fill_inside = !fill_outside; - - elm_obj_image_sizing_eval(obj); -} - -EOLIAN static Eina_Bool -_elm_image_fill_outside_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd) -{ - return !sd->fill_inside; -} - -EOLIAN static void _elm_image_preload_disabled_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool disable) { if (sd->edje || !sd->img) return; @@ -1662,4 +1648,24 @@ elm_image_scale_get(const Evas_Object *obj) return sd->scale; } +EAPI void +elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) +{ + ELM_IMAGE_CHECK(obj); + ELM_IMAGE_DATA_GET(obj, sd); + + sd->fill_inside = !fill_outside; + + elm_obj_image_sizing_eval(obj); +} + +EAPI Eina_Bool +elm_image_fill_outside_get(const Evas_Object *obj) +{ + ELM_IMAGE_CHECK(obj) EINA_FALSE; + ELM_IMAGE_DATA_GET(obj, sd); + + return !sd->fill_inside; +} + #include "elm_image.eo.c" diff --git a/src/lib/elementary/elm_image.eo b/src/lib/elementary/elm_image.eo index de511e0..8c54a43 100644 --- a/src/lib/elementary/elm_image.eo +++ b/src/lib/elementary/elm_image.eo @@ -120,7 +120,7 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface, The original aspect ratio (width / height) of the image is usually distorted to match the object's size. Enabling this option will retain this original aspect, and the way that the image is fit into the object's - area depends on the option set by @.fill_outside.]] + area depends on the option set by @.fill_inside.]] } get { } @@ -140,27 +140,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface, orient: Elm.Image_Orient; [[The image orientation Elm.Image.Orient Default is #ELM_IMAGE_ORIENT_NONE.]] } } - @property fill_outside { - [[Control if the image fills the entire object area, when keeping the aspect ratio. - - When the image should keep its aspect ratio even if resized to another - aspect ratio, there are two possibilities to resize it: keep the entire - image inside the limits of height and width of the object ($fill_outside - is $false) or let the extra width or height go outside of the object, - and the image will fill the entire object ($fill_outside is $true). - - Note: This option will have no effect if @.aspect_fixed - is set to $false. - - See also @.fill_inside.]] - set { - } - get { - } - values { - fill_outside: bool; [[$true if the object is filled outside, $false otherwise. Default is $false.]] - } - } @property resizable { [[Control if the object is (up/down) resizable. diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h index ff402dc..860cd99 100644 --- a/src/lib/elementary/elm_image_legacy.h +++ b/src/lib/elementary/elm_image_legacy.h @@ -320,4 +320,49 @@ EAPI void elm_image_scale_set(Evas_Object *obj, double scale); * @ingroup Elm_Image */ EAPI double elm_image_scale_get(const Evas_Object *obj); + +/** + * @brief Control if the image fills the entire object area, when keeping the + * aspect ratio. + * + * When the image should keep its aspect ratio even if resized to another + * aspect ratio, there are two possibilities to resize it: keep the entire + * image inside the limits of height and width of the object ($fill_outside is + * @c false) or let the extra width or height go outside of the object, and the + * image will fill the entire object ($fill_outside is @c true). + * + * @note This option will have no effect if @ref elm_image_aspect_fixed_get is + * set to @c false. + * + * See also @ref Elm.Image.fill_inside. + * + * @param[in] fill_outside @c true if the object is filled outside, @c false + * otherwise. Default is @c false. + * + * @ingroup Elm_Image + */ +EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); + +/** + * @brief Control if the image fills the entire object area, when keeping the + * aspect ratio. + * + * When the image should keep its aspect ratio even if resized to another + * aspect ratio, there are two possibilities to resize it: keep the entire + * image inside the limits of height and width of the object ($fill_outside is + * @c false) or let the extra width or height go outside of the object, and the + * image will fill the entire object ($fill_outside is @c true). + * + * @note This option will have no effect if @ref elm_image_aspect_fixed_get is + * set to @c false. + * + * See also @ref Elm.Image.fill_inside. + * + * @return @c true if the object is filled outside, @c false otherwise. Default + * is @c false. + * + * @ingroup Elm_Image + */ +EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj); + #include "elm_image.eo.legacy.h" -- 2.7.4