elementary/elm_image - added 2 APIs elm_image_aspect_ratio_retained_set/get
authorChunEon Park <hermet@hermet.pe.kr>
Mon, 27 Jun 2011 05:02:40 +0000 (05:02 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Mon, 27 Jun 2011 05:02:40 +0000 (05:02 +0000)
these API allows the image to resize with changeable aspect ratio.

SVN revision: 60719

legacy/elementary/src/lib/Elementary.h.in
legacy/elementary/src/lib/elm_image.c

index 064cc6c..4cf6621 100644 (file)
@@ -1858,6 +1858,9 @@ extern "C" {
    EAPI void             elm_image_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool        elm_image_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI Evas_Object     *elm_image_object_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EAPI void             elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained) EINA_ARG_NONNULL(1);
+   EAPI Eina_Bool        elm_image_aspect_ratio_retained_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
    /* smart callbacks called:
     * "clicked" - the user clicked the image
     */
index 80fa999..93baa5f 100644 (file)
@@ -509,4 +509,38 @@ elm_image_object_get(const Evas_Object *obj)
    return _els_smart_icon_object_get(wd->img);
 }
 
+/**
+ * Enable/disable retaining up the aspect ratio of the image. 
+ *
+ * @param obj The image object.
+ * @param retained Retaining or Non retaining.
+ *
+ * @ingroup Image
+ */
+EAPI void
+elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   return _els_smart_icon_aspect_ratio_retained_set(wd->img, retained);
+}
+
+/**
+ * Get if the object retains the aspect ratio.
+ *
+ * @param obj The image object.
+ * @return If the object retains the aspect ratio.
+ *
+ * @ingroup Image
+ */
+EAPI Eina_Bool
+elm_image_aspect_ratio_retained_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_ratio_retained_get(wd->img);
+}
+
 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-3f0^-2{2(0W1st0 :*/