Elm_image: remove no_scale and resizable property.
authorJi-Youn Park <jy0703.park@samsung.com>
Mon, 11 Apr 2016 11:33:25 +0000 (20:03 +0830)
committerJi-Youn Park <jy0703.park@samsung.com>
Mon, 11 Apr 2016 11:33:25 +0000 (20:03 +0830)
elm image add new API to deal with scale type.
if we use scale type for elm_image, we don't need to use no_scale and resizable property

src/lib/elementary/elm_image.c
src/lib/elementary/elm_image.eo
src/lib/elementary/elm_image_legacy.h

index b3d300b4930de48cf69349959276dfa108865c93..11e6c06626a74ac60ce281249375415b91697e93 100644 (file)
@@ -1167,35 +1167,6 @@ _elm_image_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, i
    if (h) *h = th;
 }
 
-EOLIAN static void
-_elm_image_no_scale_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool no_scale)
-{
-   sd->no_scale = no_scale;
-
-   _elm_image_sizing_eval(obj);
-}
-
-EOLIAN static Eina_Bool
-_elm_image_no_scale_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
-{
-   return sd->no_scale;
-}
-
-EOLIAN static void
-_elm_image_resizable_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool up, Eina_Bool down)
-{
-   sd->resize_up = !!up;
-   sd->resize_down = !!down;
-
-   _elm_image_sizing_eval(obj);
-}
-
-EOLIAN static void
-_elm_image_resizable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool *size_up, Eina_Bool *size_down)
-{
-   if (size_up) *size_up = sd->resize_up;
-   if (size_down) *size_down = sd->resize_down;
-}
 
 EAPI void
 elm_image_prescale_set(Evas_Object *obj,
@@ -1782,4 +1753,42 @@ elm_image_sizing_eval(Evas_Object *obj)
    _elm_image_sizing_eval(obj);
 }
 
+EAPI void
+elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
+{
+   ELM_IMAGE_CHECK(obj);
+   ELM_IMAGE_DATA_GET(obj, sd);
+   sd->no_scale = no_scale;
+
+   _elm_image_sizing_eval(obj);
+}
+
+EAPI Eina_Bool
+elm_image_no_scale_get(const Evas_Object *obj)
+{
+   ELM_IMAGE_CHECK(obj) EINA_FALSE;
+   ELM_IMAGE_DATA_GET(obj, sd);
+   return sd->no_scale;
+}
+
+EAPI void
+elm_image_resizable_set(Evas_Object *obj, Eina_Bool up, Eina_Bool down)
+{
+   ELM_IMAGE_CHECK(obj);
+   ELM_IMAGE_DATA_GET(obj, sd);
+   sd->resize_up = !!up;
+   sd->resize_down = !!down;
+
+   _elm_image_sizing_eval(obj);
+}
+
+EAPI void
+elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down)
+{
+   ELM_IMAGE_CHECK(obj);
+   ELM_IMAGE_DATA_GET(obj, sd);
+   if (size_up) *size_up = sd->resize_up;
+   if (size_down) *size_down = sd->resize_down;
+}
+
 #include "elm_image.eo.c"
index fa9fa203b38b518cd56c4d14916e4484e3a6189a..db22497c5afb531a55a12aec9f07f0607793f89b 100644 (file)
@@ -27,21 +27,6 @@ class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,
 {
    eo_prefix: elm_obj_image;
    methods {
-      @property no_scale {
-         [[Control scaling behaviour of this object.
-
-           This function disables scaling of the elm_image widget through the
-           function elm_object_scale_set(). However, this does not affect the widget
-           size/resize in any way. For that effect, take a look at
-           @.resizable and @Elm.Widget.scale]]
-         set {
-         }
-         get {
-         }
-         values {
-            no_scale: bool; [[$true if the object is not scalable, $false otherwise. Default is $false.]]
-         }
-      }
       @property fill_inside {
          [[Control the resize method for the object's internal image when maintaining a given aspect ratio.
 
@@ -79,21 +64,6 @@ class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,
             fixed: bool; [[$true if the image should retain the aspect, $false otherwise.]]
          }
       }
-      @property resizable {
-         [[Control if the object is (up/down) resizable.
-
-           This function limits the image resize ability. If $size_up is set to
-           $false, the object can't have its height or width resized to a value
-           higher than the original image size. Same is valid for $size_down.]]
-         set {
-         }
-         get {
-         }
-         values {
-            up: bool; [[A bool to set if the object is resizable up. Default is $true.]]
-            down: bool; [[A bool to set if the object is resizable down. Default is $true.]]
-         }
-      }
    }
    implements {
       class.constructor;
index c2bf8c7d912d70cadc2307d0bf5d7ada3cace87c..2d8b1d25b34c332c3215af6687e27e1bd1f35187 100644 (file)
@@ -503,4 +503,66 @@ EAPI Eina_Bool elm_image_resize_up_get(const Evas_Object *obj);
  */
 EAPI void elm_image_sizing_eval(Evas_Object *obj);
 
+/**
+ * @brief Control if the object is (up/down) resizable.
+ *
+ * This function limits the image resize ability. If @c size_up is set to
+ * @c false, the object can't have its height or width resized to a value
+ * higher than the original image size. Same is valid for @c size_down.
+ *
+ * @param[in] up A bool to set if the object is resizable up. Default is
+ * @c true.
+ * @param[in] down A bool to set if the object is resizable down. Default is
+ * @c true.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool up, Eina_Bool down);
+
+/**
+ * @brief Control if the object is (up/down) resizable.
+ *
+ * This function limits the image resize ability. If @c size_up is set to
+ * @c false, the object can't have its height or width resized to a value
+ * higher than the original image size. Same is valid for @c size_down.
+ *
+ * @param[out] up A bool to set if the object is resizable up. Default is
+ * @c true.
+ * @param[out] down A bool to set if the object is resizable down. Default is
+ * @c true.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *up, Eina_Bool *down);
+
+/**
+ * @brief Control scaling behaviour of this object.
+ *
+ * This function disables scaling of the elm_image widget through the function
+ * elm_object_scale_set(). However, this does not affect the widget size/resize
+ * in any way. For that effect, take a look at @ref elm_image_resizable_get and
+ * @ref elm_widget_scale_get
+ *
+ * @param[in] no_scale @c true if the object is not scalable, @c false
+ * otherwise. Default is @c false.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
+
+/**
+ * @brief Control scaling behaviour of this object.
+ *
+ * This function disables scaling of the elm_image widget through the function
+ * elm_object_scale_set(). However, this does not affect the widget size/resize
+ * in any way. For that effect, take a look at @ref elm_image_resizable_get and
+ * @ref elm_widget_scale_get
+ *
+ * @return @c true if the object is not scalable, @c false otherwise. Default
+ * is @c false.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj);
+
 #include "elm_image.eo.legacy.h"