summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-03 20:27:23 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-15 14:07:39 +0900
commit256daa8eff91e0acfe5fb2e81a4f81e7bd51266c (patch)
tree2131b5e8ef9703117ee024e151ea1a00e9084ec2
parent4e06031b9c428ba3360ef4a5c1929d23b3ef65ae (diff)
Elm.Image: Adapt to recent changes in Efl.Image
-rw-r--r--src/lib/elm_image.c30
-rw-r--r--src/lib/elm_image.eo26
-rw-r--r--src/lib/elm_image_legacy.h37
3 files changed, 55 insertions, 38 deletions
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 92aacaa05..91e373a6d 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -1225,20 +1225,6 @@ _elm_image_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, const char
1225 efl_file_get(sd->img, file, key); 1225 efl_file_get(sd->img, file, key);
1226} 1226}
1227 1227
1228EOLIAN static void
1229_elm_image_smooth_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool smooth)
1230{
1231 sd->smooth = smooth;
1232
1233 elm_obj_image_sizing_eval(obj);
1234}
1235
1236EOLIAN static Eina_Bool
1237_elm_image_smooth_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
1238{
1239 return sd->smooth;
1240}
1241
1242static Eina_Bool 1228static Eina_Bool
1243_elm_image_efl_file_async_wait(const Eo *obj EINA_UNUSED, Elm_Image_Data *pd) 1229_elm_image_efl_file_async_wait(const Eo *obj EINA_UNUSED, Elm_Image_Data *pd)
1244{ 1230{
@@ -1370,7 +1356,7 @@ elm_image_prescale_set(Evas_Object *obj,
1370} 1356}
1371 1357
1372EOLIAN static void 1358EOLIAN static void
1373_elm_image_efl_image_load_size_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int w, int h) 1359_elm_image_efl_image_load_load_size_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int w, int h)
1374{ 1360{
1375 if (w > h) 1361 if (w > h)
1376 sd->load_size = w; 1362 sd->load_size = w;
@@ -1389,7 +1375,7 @@ elm_image_prescale_get(const Evas_Object *obj)
1389} 1375}
1390 1376
1391EOLIAN static void 1377EOLIAN static void
1392_elm_image_efl_image_load_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int *w, int *h) 1378_elm_image_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int *w, int *h)
1393{ 1379{
1394 if (w) *w = sd->load_size; 1380 if (w) *w = sd->load_size;
1395 if (h) *h = sd->load_size; 1381 if (h) *h = sd->load_size;
@@ -1647,6 +1633,18 @@ _elm_image_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
1647 return &atspi_actions[0]; 1633 return &atspi_actions[0];
1648} 1634}
1649 1635
1636EAPI void
1637elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
1638{
1639 efl_image_smooth_scale_set(obj, smooth);
1640 elm_obj_image_sizing_eval(obj);
1641}
1642
1643EAPI Eina_Bool
1644elm_image_smooth_get(const Evas_Object *obj)
1645{
1646 return efl_image_smooth_scale_get(obj);
1647}
1650 1648
1651// A11Y - END 1649// A11Y - END
1652 1650
diff --git a/src/lib/elm_image.eo b/src/lib/elm_image.eo
index b45887202..ea2d9666c 100644
--- a/src/lib/elm_image.eo
+++ b/src/lib/elm_image.eo
@@ -41,8 +41,8 @@ struct Elm.Image.Error
41 open_error: Eina.Bool; 41 open_error: Eina.Bool;
42} 42}
43 43
44class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface, 44class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface,
45 Edje.Object, 45 Edje.Object, Efl.Image,
46 Elm.Interface_Atspi_Image, Elm.Interface_Atspi_Widget_Action, 46 Elm.Interface_Atspi_Image, Elm.Interface_Atspi_Widget_Action,
47 Efl.Player) 47 Efl.Player)
48{ 48{
@@ -89,24 +89,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface,
89 resize_up: bool; [[whether resizing up is allowed]] 89 resize_up: bool; [[whether resizing up is allowed]]
90 } 90 }
91 } 91 }
92 @property smooth {
93 [[Control the smooth effect for an image.
94
95 Set the scaling algorithm to be used when scaling the image. Smooth
96 scaling provides a better resulting image, but is slower.
97
98 The smooth scaling should be disabled when making animations that change
99 the image size, since it will be faster. Animations that don't require
100 resizing of the image can keep the smooth scaling enabled (even if the
101 image is already scaled, since the scaled image will be cached).]]
102 set {
103 }
104 get {
105 }
106 values {
107 smooth: bool; [[$true if smooth scaling should be used, $false otherwise. Default is $true.]]
108 }
109 }
110 @property no_scale { 92 @property no_scale {
111 [[Control scaling behaviour of this object. 93 [[Control scaling behaviour of this object.
112 94
@@ -317,8 +299,8 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface,
317 Efl.File.async.set; 299 Efl.File.async.set;
318 Efl.File.async.get; 300 Efl.File.async.get;
319 Efl.File.async_wait; 301 Efl.File.async_wait;
320 Efl.Image.load_size.set; 302 Efl.Image_Load.load_size.set;
321 Efl.Image.load_size.get; 303 Efl.Image_Load.load_size.get;
322 Efl.Image.smooth_scale.set; 304 Efl.Image.smooth_scale.set;
323 Efl.Image.smooth_scale.get; 305 Efl.Image.smooth_scale.get;
324 Efl.Player.playable.get; 306 Efl.Player.playable.get;
diff --git a/src/lib/elm_image_legacy.h b/src/lib/elm_image_legacy.h
index 5d6a06f90..15d1e65b2 100644
--- a/src/lib/elm_image_legacy.h
+++ b/src/lib/elm_image_legacy.h
@@ -113,6 +113,43 @@ EAPI int elm_image_prescale_get(const Evas_Object *obj);
113EAPI Eina_Bool elm_image_mmap_set(Evas_Object *obj, const Eina_File *file, const char *group); 113EAPI Eina_Bool elm_image_mmap_set(Evas_Object *obj, const Eina_File *file, const char *group);
114 114
115/** 115/**
116 * @brief Control the smooth effect for an image.
117 *
118 * Set the scaling algorithm to be used when scaling the image. Smooth scaling
119 * provides a better resulting image, but is slower.
120 *
121 * The smooth scaling should be disabled when making animations that change the
122 * image size, since it will be faster. Animations that don't require resizing
123 * of the image can keep the smooth scaling enabled (even if the image is
124 * already scaled, since the scaled image will be cached).
125 *
126 * @param[in] smooth @c true if smooth scaling should be used, @c false
127 * otherwise. Default is @c true.
128 *
129 * @ingroup Elm_Image
130 */
131EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth);
132
133/**
134 * @brief Get the smooth effect for an image.
135 *
136 * Get the scaling algorithm to be used when scaling the image. Smooth scaling
137 * provides a better resulting image, but is slower.
138 *
139 * The smooth scaling should be disabled when making animations that change the
140 * image size, since it will be faster. Animations that don't require resizing
141 * of the image can keep the smooth scaling enabled (even if the image is
142 * already scaled, since the scaled image will be cached).
143 *
144 * @return @c true if smooth scaling should be used, @c false otherwise.
145 * Default is @c true.
146 *
147 * @ingroup Elm_Image
148 */
149EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj);
150
151
152/**
116 * Start or stop an image object's animation. 153 * Start or stop an image object's animation.
117 * 154 *
118 * To actually start playing any image object's animation, if it 155 * To actually start playing any image object's animation, if it