From 66b9884ab3733affcb72095d4dcafbef2370045f Mon Sep 17 00:00:00 2001 From: Ji-Youn Park Date: Fri, 1 Apr 2016 14:36:55 +0830 Subject: [PATCH] Elm_image: move preload_disabled API from eo to legacy. --- src/lib/elementary/elm_image.c | 48 +++++++++++++++++++---------------- src/lib/elementary/elm_image.eo | 8 ------ src/lib/elementary/elm_image_legacy.h | 9 +++++++ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/lib/elementary/elm_image.c b/src/lib/elementary/elm_image.c index 7ae9e46..c5ebf5f 100644 --- a/src/lib/elementary/elm_image.c +++ b/src/lib/elementary/elm_image.c @@ -1230,28 +1230,6 @@ _elm_image_resizable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool *siz if (size_down) *size_down = sd->resize_down; } -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; - - if (disable) - { - if (sd->preload_status == ELM_IMAGE_PRELOADING) - { - evas_object_image_preload(sd->img, disable); - if (sd->show) evas_object_show(sd->img); - ELM_SAFE_FREE(sd->prev_img, evas_object_del); - } - sd->preload_status = ELM_IMAGE_PRELOAD_DISABLED; - } - else if (sd->preload_status == ELM_IMAGE_PRELOAD_DISABLED) - { - sd->preload_status = ELM_IMAGE_PRELOADING; - evas_object_image_preload(sd->img, disable); - } -} - EAPI void elm_image_prescale_set(Evas_Object *obj, int size) @@ -1668,4 +1646,30 @@ elm_image_fill_outside_get(const Evas_Object *obj) return !sd->fill_inside; } +// TODO: merge preload and async code +EAPI void +elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable) +{ + ELM_IMAGE_CHECK(obj); + ELM_IMAGE_DATA_GET(obj, sd); + + if (sd->edje || !sd->img) return; + + if (disable) + { + if (sd->preload_status == ELM_IMAGE_PRELOADING) + { + evas_object_image_preload(sd->img, disable); + if (sd->show) evas_object_show(sd->img); + ELM_SAFE_FREE(sd->prev_img, evas_object_del); + } + sd->preload_status = ELM_IMAGE_PRELOAD_DISABLED; + } + else if (sd->preload_status == ELM_IMAGE_PRELOAD_DISABLED) + { + sd->preload_status = ELM_IMAGE_PRELOADING; + evas_object_image_preload(sd->img, disable); + } +} + #include "elm_image.eo.c" diff --git a/src/lib/elementary/elm_image.eo b/src/lib/elementary/elm_image.eo index 8c54a43..a65eca8 100644 --- a/src/lib/elementary/elm_image.eo +++ b/src/lib/elementary/elm_image.eo @@ -155,14 +155,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface, down: bool; [[A bool to set if the object is resizable down. Default is $true.]] } } - @property preload_disabled { - set { - [[Enable or disable preloading of the image]] - } - values { - disabled: bool; [[If true, preloading will be disabled]] - } - } @property object { get { [[Get the inlined image object of the image widget. diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h index 860cd99..373d4e5 100644 --- a/src/lib/elementary/elm_image_legacy.h +++ b/src/lib/elementary/elm_image_legacy.h @@ -365,4 +365,13 @@ EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); */ EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj); +/** + * @brief Enable or disable preloading of the image + * + * @param[in] disabled If true, preloading will be disabled + * + * @ingroup Elm_Image + */ + +EAPI void elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled); #include "elm_image.eo.legacy.h" -- 2.7.4