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
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,
_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"
{
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.
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;
*/
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"