summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi-Youn Park <jy0703.park@samsung.com>2016-04-11 20:03:25 +0830
committerJi-Youn Park <jy0703.park@samsung.com>2016-04-11 20:03:25 +0830
commit810ebb5db8e0ba97756cb0af8d701d973394379a (patch)
tree6913055e64de554c73cc65f4bd3f3e3b2150cae4
parent7b4c23489d134b18a937ed90eac0d964f77e98fd (diff)
Elm_image: remove no_scale and resizable property.
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
-rw-r--r--src/lib/elementary/elm_image.c67
-rw-r--r--src/lib/elementary/elm_image.eo30
-rw-r--r--src/lib/elementary/elm_image_legacy.h62
3 files changed, 100 insertions, 59 deletions
diff --git a/src/lib/elementary/elm_image.c b/src/lib/elementary/elm_image.c
index b3d300b493..11e6c06626 100644
--- a/src/lib/elementary/elm_image.c
+++ b/src/lib/elementary/elm_image.c
@@ -1167,35 +1167,6 @@ _elm_image_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, i
1167 if (h) *h = th; 1167 if (h) *h = th;
1168} 1168}
1169 1169
1170EOLIAN static void
1171_elm_image_no_scale_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool no_scale)
1172{
1173 sd->no_scale = no_scale;
1174
1175 _elm_image_sizing_eval(obj);
1176}
1177
1178EOLIAN static Eina_Bool
1179_elm_image_no_scale_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
1180{
1181 return sd->no_scale;
1182}
1183
1184EOLIAN static void
1185_elm_image_resizable_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool up, Eina_Bool down)
1186{
1187 sd->resize_up = !!up;
1188 sd->resize_down = !!down;
1189
1190 _elm_image_sizing_eval(obj);
1191}
1192
1193EOLIAN static void
1194_elm_image_resizable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool *size_up, Eina_Bool *size_down)
1195{
1196 if (size_up) *size_up = sd->resize_up;
1197 if (size_down) *size_down = sd->resize_down;
1198}
1199 1170
1200EAPI void 1171EAPI void
1201elm_image_prescale_set(Evas_Object *obj, 1172elm_image_prescale_set(Evas_Object *obj,
@@ -1782,4 +1753,42 @@ elm_image_sizing_eval(Evas_Object *obj)
1782 _elm_image_sizing_eval(obj); 1753 _elm_image_sizing_eval(obj);
1783} 1754}
1784 1755
1756EAPI void
1757elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
1758{
1759 ELM_IMAGE_CHECK(obj);
1760 ELM_IMAGE_DATA_GET(obj, sd);
1761 sd->no_scale = no_scale;
1762
1763 _elm_image_sizing_eval(obj);
1764}
1765
1766EAPI Eina_Bool
1767elm_image_no_scale_get(const Evas_Object *obj)
1768{
1769 ELM_IMAGE_CHECK(obj) EINA_FALSE;
1770 ELM_IMAGE_DATA_GET(obj, sd);
1771 return sd->no_scale;
1772}
1773
1774EAPI void
1775elm_image_resizable_set(Evas_Object *obj, Eina_Bool up, Eina_Bool down)
1776{
1777 ELM_IMAGE_CHECK(obj);
1778 ELM_IMAGE_DATA_GET(obj, sd);
1779 sd->resize_up = !!up;
1780 sd->resize_down = !!down;
1781
1782 _elm_image_sizing_eval(obj);
1783}
1784
1785EAPI void
1786elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down)
1787{
1788 ELM_IMAGE_CHECK(obj);
1789 ELM_IMAGE_DATA_GET(obj, sd);
1790 if (size_up) *size_up = sd->resize_up;
1791 if (size_down) *size_down = sd->resize_down;
1792}
1793
1785#include "elm_image.eo.c" 1794#include "elm_image.eo.c"
diff --git a/src/lib/elementary/elm_image.eo b/src/lib/elementary/elm_image.eo
index fa9fa203b3..db22497c5a 100644
--- a/src/lib/elementary/elm_image.eo
+++ b/src/lib/elementary/elm_image.eo
@@ -27,21 +27,6 @@ class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,
27{ 27{
28 eo_prefix: elm_obj_image; 28 eo_prefix: elm_obj_image;
29 methods { 29 methods {
30 @property no_scale {
31 [[Control scaling behaviour of this object.
32
33 This function disables scaling of the elm_image widget through the
34 function elm_object_scale_set(). However, this does not affect the widget
35 size/resize in any way. For that effect, take a look at
36 @.resizable and @Elm.Widget.scale]]
37 set {
38 }
39 get {
40 }
41 values {
42 no_scale: bool; [[$true if the object is not scalable, $false otherwise. Default is $false.]]
43 }
44 }
45 @property fill_inside { 30 @property fill_inside {
46 [[Control the resize method for the object's internal image when maintaining a given aspect ratio. 31 [[Control the resize method for the object's internal image when maintaining a given aspect ratio.
47 32
@@ -79,21 +64,6 @@ class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,
79 fixed: bool; [[$true if the image should retain the aspect, $false otherwise.]] 64 fixed: bool; [[$true if the image should retain the aspect, $false otherwise.]]
80 } 65 }
81 } 66 }
82 @property resizable {
83 [[Control if the object is (up/down) resizable.
84
85 This function limits the image resize ability. If $size_up is set to
86 $false, the object can't have its height or width resized to a value
87 higher than the original image size. Same is valid for $size_down.]]
88 set {
89 }
90 get {
91 }
92 values {
93 up: bool; [[A bool to set if the object is resizable up. Default is $true.]]
94 down: bool; [[A bool to set if the object is resizable down. Default is $true.]]
95 }
96 }
97 } 67 }
98 implements { 68 implements {
99 class.constructor; 69 class.constructor;
diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h
index c2bf8c7d91..2d8b1d25b3 100644
--- a/src/lib/elementary/elm_image_legacy.h
+++ b/src/lib/elementary/elm_image_legacy.h
@@ -503,4 +503,66 @@ EAPI Eina_Bool elm_image_resize_up_get(const Evas_Object *obj);
503 */ 503 */
504EAPI void elm_image_sizing_eval(Evas_Object *obj); 504EAPI void elm_image_sizing_eval(Evas_Object *obj);
505 505
506/**
507 * @brief Control if the object is (up/down) resizable.
508 *
509 * This function limits the image resize ability. If @c size_up is set to
510 * @c false, the object can't have its height or width resized to a value
511 * higher than the original image size. Same is valid for @c size_down.
512 *
513 * @param[in] up A bool to set if the object is resizable up. Default is
514 * @c true.
515 * @param[in] down A bool to set if the object is resizable down. Default is
516 * @c true.
517 *
518 * @ingroup Elm_Image
519 */
520EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool up, Eina_Bool down);
521
522/**
523 * @brief Control if the object is (up/down) resizable.
524 *
525 * This function limits the image resize ability. If @c size_up is set to
526 * @c false, the object can't have its height or width resized to a value
527 * higher than the original image size. Same is valid for @c size_down.
528 *
529 * @param[out] up A bool to set if the object is resizable up. Default is
530 * @c true.
531 * @param[out] down A bool to set if the object is resizable down. Default is
532 * @c true.
533 *
534 * @ingroup Elm_Image
535 */
536EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *up, Eina_Bool *down);
537
538/**
539 * @brief Control scaling behaviour of this object.
540 *
541 * This function disables scaling of the elm_image widget through the function
542 * elm_object_scale_set(). However, this does not affect the widget size/resize
543 * in any way. For that effect, take a look at @ref elm_image_resizable_get and
544 * @ref elm_widget_scale_get
545 *
546 * @param[in] no_scale @c true if the object is not scalable, @c false
547 * otherwise. Default is @c false.
548 *
549 * @ingroup Elm_Image
550 */
551EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
552
553/**
554 * @brief Control scaling behaviour of this object.
555 *
556 * This function disables scaling of the elm_image widget through the function
557 * elm_object_scale_set(). However, this does not affect the widget size/resize
558 * in any way. For that effect, take a look at @ref elm_image_resizable_get and
559 * @ref elm_widget_scale_get
560 *
561 * @return @c true if the object is not scalable, @c false otherwise. Default
562 * is @c false.
563 *
564 * @ingroup Elm_Image
565 */
566EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj);
567
506#include "elm_image.eo.legacy.h" 568#include "elm_image.eo.legacy.h"