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)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Nov 2011 04:25:16 +0000 (04:25 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/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 fd09a7c..96b1ac4 100644 (file)
@@ -5088,6 +5088,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 273db62..eb909b1 100644 (file)
@@ -1024,3 +1024,13 @@ elm_icon_object_get(Evas_Object *obj)
    if (!wd) return NULL;
    return _els_smart_icon_object_get(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 eb123a0..9005f6d 100644 (file)
@@ -141,6 +141,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 2d1cce2..641aa3d 100644 (file)
@@ -24,4 +24,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);