aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJi-Youn Park <jy0703.park@samsung.com>2016-03-23 09:23:47 (GMT)
committerJi-Youn Park <jy0703.park@samsung.com>2016-03-23 09:23:51 (GMT)
commit4d011e43a9fa6ad3d880754aa52a9f94d0fb02d8 (patch)
tree1ca0bb450e4a075fc95d3dd46a98357ab9727d3c
parentpopup: visual related signals should be processed immediately (diff)
downloadelementary-4d011e43a9fa6ad3d880754aa52a9f94d0fb02d8.tar.gz
Elm_Image: remove Elm.Image.scale property. use the Elm.Widget.scale.
elm image don't need to manage scale value itself. Just modify eo part. legacy c part(ex: remove scale data in elm image)is still remains.
-rw-r--r--src/lib/elm_image.c50
-rw-r--r--src/lib/elm_image.eo14
-rw-r--r--src/lib/elm_image_legacy.h22
3 files changed, 56 insertions, 30 deletions
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index c3025bf..e5b533e 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -797,6 +797,15 @@ _elm_image_elm_widget_event(Eo *obj, Elm_Image_Data *_pd EINA_UNUSED, Evas_Objec
return EINA_TRUE;
}
+// TODO: remove this function after using the widget's scale value instead of image's scale value,
+
+static void
+_elm_image_internal_scale_set(Evas_Object *obj, Elm_Image_Data *sd, double scale)
+{
+ sd->scale = scale;
+ _elm_image_internal_sizing_eval(obj, sd);
+}
+
EOLIAN static void
_elm_image_sizing_eval(Eo *obj, Elm_Image_Data *sd)
{
@@ -807,9 +816,9 @@ _elm_image_sizing_eval(Eo *obj, Elm_Image_Data *sd)
efl_image_smooth_scale_set(obj, sd->smooth);
if (sd->no_scale)
- elm_obj_image_scale_set(obj, 1.0);
+ _elm_image_internal_scale_set(obj, sd, 1.0);
else
- elm_obj_image_scale_set(obj, elm_widget_scale_get(obj) * elm_config_scale_get());
+ _elm_image_internal_scale_set(obj, sd, elm_widget_scale_get(obj) * elm_config_scale_get());
ts = sd->scale;
sd->scale = 1.0;
@@ -883,20 +892,6 @@ _elm_image_file_set_do(Evas_Object *obj)
}
}
-EOLIAN static void
-_elm_image_scale_set(Eo *obj, Elm_Image_Data *sd, double scale)
-{
- sd->scale = scale;
-
- _elm_image_internal_sizing_eval(obj, sd);
-}
-
-EOLIAN static double
-_elm_image_scale_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
-{
- return sd->scale;
-}
-
EAPI Evas_Object *
elm_image_add(Evas_Object *parent)
{
@@ -1644,4 +1639,27 @@ elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char
return EINA_TRUE;
}
+// TODO: use the widget's scale value instead of image's scale value.
+
+EAPI void
+elm_image_scale_set(Evas_Object *obj,
+ double scale)
+{
+ ELM_IMAGE_CHECK(obj);
+ ELM_IMAGE_DATA_GET(obj, sd);
+
+ sd->scale = scale;
+
+ _elm_image_internal_sizing_eval(obj, sd);
+}
+
+EAPI double
+elm_image_scale_get(const Evas_Object *obj)
+{
+ ELM_IMAGE_CHECK(obj) -1;
+ ELM_IMAGE_DATA_GET(obj, sd);
+
+ return sd->scale;
+}
+
#include "elm_image.eo.c"
diff --git a/src/lib/elm_image.eo b/src/lib/elm_image.eo
index 52ca4b0..de511e0 100644
--- a/src/lib/elm_image.eo
+++ b/src/lib/elm_image.eo
@@ -91,20 +91,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface,
no_scale: bool; [[$true if the object is not scalable, $false otherwise. Default is $false.]]
}
}
- @property scale {
- [[Control the scale of the object's image.
-
- @since 1.7]]
- set {
- legacy: null;
- }
- get {
- legacy: null;
- }
- values {
- scale: double; [[Object's image scale.]]
- }
- }
@property fill_inside {
[[Control the resize method for the object's internal image when maintaining a given aspect ratio.
diff --git a/src/lib/elm_image_legacy.h b/src/lib/elm_image_legacy.h
index db79883..ff402dc 100644
--- a/src/lib/elm_image_legacy.h
+++ b/src/lib/elm_image_legacy.h
@@ -298,4 +298,26 @@ EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj);
* @ingroup Elm_Image
*/
EAPI Eina_Bool elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key);
+
+/**
+ * @brief Control the scale of the object's image.
+ *
+ * @param[in] scale Object's image scale.
+ *
+ * @since 1.7
+ *
+ * @ingroup Elm_Image
+ */
+EAPI void elm_image_scale_set(Evas_Object *obj, double scale);
+
+/**
+ * @brief Control the scale of the object's image.
+ *
+ * @return Object's image scale.
+ *
+ * @since 1.7
+ *
+ * @ingroup Elm_Image
+ */
+EAPI double elm_image_scale_get(const Evas_Object *obj);
#include "elm_image.eo.legacy.h"