port aspect_fixed from image to icon
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Feb 2012 22:48:32 +0000 (22:48 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Feb 2012 22:48:32 +0000 (22:48 +0000)
remind me again: why do we have more than one image api here??????????

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68045 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_icon.c
src/lib/elm_icon.h

index 180711d..75bdfc7 100644 (file)
@@ -983,3 +983,21 @@ elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable)
    if (!wd) return;
    _els_smart_icon_preload_set(wd->img, disable);
 }
+
+EAPI void
+elm_icon_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   _els_smart_icon_aspect_fixed_set(wd->img, fixed);
+}
+
+EAPI Eina_Bool
+elm_icon_aspect_fixed_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   return _els_smart_icon_aspect_fixed_get(wd->img);
+}
index ae24800..fff6092 100644 (file)
@@ -531,5 +531,35 @@ EAPI void                  elm_icon_animated_play_set(Evas_Object *obj, Eina_Boo
 EAPI Eina_Bool             elm_icon_animated_play_get(const Evas_Object *obj);
 
 /**
+ * Set whether the original aspect ratio of the icon should be kept on resize.
+ *
+ * @param obj The icon object.
+ * @param fixed @c EINA_TRUE if the icon should retain the aspect,
+ * @c EINA_FALSE otherwise.
+ *
+ * The original aspect ratio (width / height) of the icon is usually
+ * distorted to match the object's size. Enabling this option will retain
+ * this original aspect, and the way that the icon is fit into the object's
+ * area depends on the option set by elm_icon_fill_outside_set().
+ *
+ * @see elm_icon_aspect_fixed_get()
+ * @see elm_icon_fill_outside_set()
+ *
+ * @ingroup Icon
+ */
+EAPI void             elm_icon_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed);
+
+/**
+ * Get if the object retains the original aspect ratio.
+ *
+ * @param obj The icon object.
+ * @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE
+ * otherwise.
+ *
+ * @ingroup Icon
+ */
+EAPI Eina_Bool        elm_icon_aspect_fixed_get(const Evas_Object *obj);
+
+/**
  * @}
  */