jypark pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=ae64b6366713c3e579f8a6905ee444dd97149f75

commit ae64b6366713c3e579f8a6905ee444dd97149f75
Author: Ji-Youn Park <jy0703.p...@samsung.com>
Date:   Thu Mar 24 16:41:49 2016 +0830

    Elm_image: move preload_disabled API from eo to legacy.
---
 src/lib/elm_image.c        | 48 +++++++++++++++++++++++++---------------------
 src/lib/elm_image.eo       |  8 --------
 src/lib/elm_image_legacy.h | 10 ++++++++++
 3 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 7ae9e46..c5ebf5f 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/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/elm_image.eo b/src/lib/elm_image.eo
index 8c54a43..a65eca8 100644
--- a/src/lib/elm_image.eo
+++ b/src/lib/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/elm_image_legacy.h b/src/lib/elm_image_legacy.h
index 860cd99..4d4e1d8 100644
--- a/src/lib/elm_image_legacy.h
+++ b/src/lib/elm_image_legacy.h
@@ -365,4 +365,14 @@ 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"

-- 


Reply via email to