add new function to disable icon preloading
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Nov 2011 04:25:16 +0000 (04:25 +0000)
committerMike McCormack <mj.mccormack@samsung.com>
Wed, 9 Nov 2011 01:42:16 +0000 (10:42 +0900)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@64850 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Elementary.h.in
src/lib/elm_icon.c
src/lib/els_icon.c
src/lib/els_icon.h

index 13869c3..5ad2a4d 100644 (file)
@@ -4989,6 +4989,14 @@ extern "C" {
     */
    EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    /**
+    * Enable or disable preloading of the icon
+    *
+    * @param obj The icon object
+    * @param disable If EINA_TRUE, preloading will be disabled
+    * @ingroup Icon
+    */
+   EAPI void                  elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable) EINA_ARG_NONNULL(1);
+   /**
     * Get if the icon supports animation or not.
     *
     * @param obj The icon object
index c65d085..72abbb8 100644 (file)
@@ -987,3 +987,13 @@ elm_icon_object_get(Evas_Object *obj)
    if (!wd) return NULL;
    return wd->img;
 }
+
+EAPI void
+elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   if (!wd) return;
+   _els_smart_icon_preload_set(wd->img, disable);
+}
index 0d3dd0b..2c9d5f3 100755 (executable)
@@ -116,6 +116,17 @@ _els_smart_icon_file_key_set(Evas_Object *obj, const char *file, const char *key
    return EINA_TRUE;
 }
 
+void
+_els_smart_icon_preload_set(Evas_Object *obj, Eina_Bool disable)
+{
+   Smart_Data *sd;
+
+   sd = evas_object_smart_data_get(obj);
+   if ((!sd) || sd->edje) return;
+   evas_object_image_preload(sd->obj, disable);
+   sd->preloading = !disable;
+}
+
 Eina_Bool
 _els_smart_icon_file_edje_set(Evas_Object *obj, const char *file, const char *part)
 {
index bd49bb2..dccbccd 100644 (file)
@@ -23,4 +23,4 @@ Eina_Bool    _els_smart_icon_edit_get         (const Evas_Object *obj);
 Evas_Object *_els_smart_icon_edje_get(Evas_Object *obj);
 void         _els_smart_icon_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained);
 Eina_Bool    _els_smart_icon_aspect_ratio_retained_get(const Evas_Object *obj);
-
+void _els_smart_icon_preload_set(Evas_Object *obj, Eina_Bool disable);