summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-05-20 11:51:56 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-20 11:51:56 -0400
commitb24fde67871707bafea7d3e638bca70c6ef75de0 (patch)
tree76ac9e3133401b0321df5b960d4866ecf8a568ce /src
parenta5267d3d9c55ebcc2da3e7e05b23bc88d436f3fb (diff)
Merge Efl.Orient and Efl.Flip into the same enum
Summary: This is similar to how it is in Evas, and simplifies the Efl.Orientation interface, which only needs one property now. Relates to T7919 Test Plan: Everything builds and tests pass. There's only one example of efl_orientation_set() so there's not much to test yet. Reviewers: zmike, bu5hm4n, cedric, Hermet, Jaehyun_Cho Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7919 Differential Revision: https://phab.enlightenment.org/D8912
Diffstat (limited to 'src')
-rw-r--r--src/examples/evas/evas-images5.c15
-rw-r--r--src/lib/efl/interfaces/efl_orientation.eo52
-rw-r--r--src/lib/elementary/efl_ui_image.c82
-rw-r--r--src/lib/elementary/efl_ui_image.eo1
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c142
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo1
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_private.h1
-rw-r--r--src/lib/elementary/efl_ui_widget_image.h1
-rw-r--r--src/lib/evas/canvas/efl_canvas_image_internal.eo1
-rw-r--r--src/lib/evas/canvas/evas_image_private.h1
-rw-r--r--src/lib/evas/canvas/evas_object_image.c90
11 files changed, 108 insertions, 279 deletions
diff --git a/src/examples/evas/evas-images5.c b/src/examples/evas/evas-images5.c
index ed8a4e5541..fa2794e952 100644
--- a/src/examples/evas/evas-images5.c
+++ b/src/examples/evas/evas-images5.c
@@ -76,6 +76,7 @@ _on_keydown(void *data EINA_UNUSED,
76 void *einfo) 76 void *einfo)
77{ 77{
78 Evas_Event_Key_Down *ev = einfo; 78 Evas_Event_Key_Down *ev = einfo;
79 Efl_Orient orient = efl_orientation_get(d.img);
79 80
80 if (strcmp(ev->key, "h") == 0) /* print help */ 81 if (strcmp(ev->key, "h") == 0) /* print help */
81 { 82 {
@@ -109,25 +110,25 @@ _on_keydown(void *data EINA_UNUSED,
109 switch (key_val) 110 switch (key_val)
110 { 111 {
111 case 0: 112 case 0:
112 efl_orientation_set(d.img, EFL_ORIENT_0); 113 efl_orientation_set(d.img, EFL_ORIENT_UP | (orient & EFL_ORIENT_FLIP_BITMASK));
113 break; 114 break;
114 case 1: 115 case 1:
115 efl_orientation_set(d.img, EFL_ORIENT_90); 116 efl_orientation_set(d.img, EFL_ORIENT_RIGHT | (orient & EFL_ORIENT_FLIP_BITMASK));
116 break; 117 break;
117 case 2: 118 case 2:
118 efl_orientation_set(d.img, EFL_ORIENT_180); 119 efl_orientation_set(d.img, EFL_ORIENT_DOWN | (orient & EFL_ORIENT_FLIP_BITMASK));
119 break; 120 break;
120 case 3: 121 case 3:
121 efl_orientation_set(d.img, EFL_ORIENT_270); 122 efl_orientation_set(d.img, EFL_ORIENT_LEFT | (orient & EFL_ORIENT_FLIP_BITMASK));
122 break; 123 break;
123 case 4: 124 case 4:
124 efl_orientation_flip_set(d.img, EFL_FLIP_HORIZONTAL); 125 efl_orientation_set(d.img, (orient & EFL_ORIENT_ROTATION_BITMASK) | EFL_ORIENT_FLIP_HORIZONTAL);
125 break; 126 break;
126 case 5: 127 case 5:
127 efl_orientation_flip_set(d.img, EFL_FLIP_VERTICAL); 128 efl_orientation_set(d.img, (orient & EFL_ORIENT_ROTATION_BITMASK) | EFL_ORIENT_FLIP_VERTICAL);
128 break; 129 break;
129 case 6: 130 case 6:
130 efl_orientation_flip_set(d.img, EFL_FLIP_NONE); 131 efl_orientation_set(d.img, (orient & EFL_ORIENT_ROTATION_BITMASK));
131 break; 132 break;
132 } 133 }
133} 134}
diff --git a/src/lib/efl/interfaces/efl_orientation.eo b/src/lib/efl/interfaces/efl_orientation.eo
index e874dcfdb7..be42be5eca 100644
--- a/src/lib/efl/interfaces/efl_orientation.eo
+++ b/src/lib/efl/interfaces/efl_orientation.eo
@@ -2,38 +2,35 @@ parse efl_ui_direction;
2 2
3enum @beta Efl.Orient 3enum @beta Efl.Orient
4{ 4{
5 [[An orientation type, to rotate visual objects. 5 [[An orientation type, to rotate and flip images.
6 6
7 This is similar to EXIF's orientation.
8 Directional values ($up, $down, $left, $right) indicate the final direction in
9 which the top of the image will be facing (e.g. a picture of a house will have
10 its roof pointing to the right if the $right orientation is used).
11 Flipping values ($flip_horizontal and $flip_vertical) can be additionaly added
12 to produce a mirroring in each axis.
7 Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather 13 Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather
8 than images and canvases. This enum is used to rotate images, videos and 14 than images and canvases. This enum is used to rotate images, videos and
9 the like. 15 the like.
10
11 See also @Efl.Orientation.
12 ]]
13 none = 0, [[Default, same as up]]
14 up = 0, [[Orient up, do not rotate.]]
15 right = 90, [[Orient right, rotate 90 degrees counter clock-wise.]]
16 down = 180, [[Orient down, rotate 180 degrees.]]
17 left = 270, [[Orient left, rotate 90 degrees clock-wise.]]
18}
19
20enum @beta Efl.Flip
21{
22 [[A flip type, to flip visual objects.
23
24 See also @Efl.Orientation.
25 ]] 16 ]]
26 none = 0, [[No flip]] 17 none = 0, [[Default, same as up, do not rotate.]]
27 horizontal = 1, [[Flip image horizontally]] 18 up = 0, [[Orient up, do not rotate.]]
28 vertical = 2 [[Flip image vertically]] 19 right = 1, [[Orient right, rotate 90 degrees clock-wise.]]
20 down = 2, [[Orient down, rotate 180 degrees.]]
21 left = 3, [[Orient left, rotate 270 degrees clock-wise.]]
22 rotation_bitmask = 3, [[Bitmask that can be used to isolate rotation values, that is, $none, $up, $down, $left and $right.]]
23 flip_horizontal = 4, [[Mirror horizontally. Can be added to the other values.]]
24 flip_vertical = 8, [[Mirror vertically. Can be added to the other values.]]
25 flip_bitmask = 12 [[Bitmask that can be used to isolate flipping values, that is, $flip_vertical and $flip_horizontal.]]
29} 26}
30 27
31interface @beta Efl.Orientation 28interface @beta Efl.Orientation
32{ 29{
33 [[Efl orientation interface]] 30 [[Interface for objects which can be oriented.]]
34 methods { 31 methods {
35 @property orientation { 32 @property orientation {
36 [[Control the orientation of a given object. 33 [[Control the orientation (rotation and flipping) of a given object.
37 34
38 This can be used to set the rotation on an image or a window, for 35 This can be used to set the rotation on an image or a window, for
39 instance. 36 instance.
@@ -42,16 +39,5 @@ interface @beta Efl.Orientation
42 dir: Efl.Orient(Efl.Orient.none); [[The rotation angle (CCW), see @Efl.Orient.]] 39 dir: Efl.Orient(Efl.Orient.none); [[The rotation angle (CCW), see @Efl.Orient.]]
43 } 40 }
44 } 41 }
45 @property flip {
46 [[Control the flip of the given image
47
48 Use this function to change how your image is to be
49 flipped: vertically or horizontally or transpose
50 or traverse.
51 ]]
52 values {
53 flip: Efl.Flip; [[Flip method]]
54 }
55 }
56 } 42 }
57} 43}
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 8fde088c88..687bdbcfec 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -808,7 +808,6 @@ _efl_ui_image_sizing_eval(Evas_Object *obj)
808 if (!sd->edje) 808 if (!sd->edje)
809 { 809 {
810 efl_orientation_set(sd->img, sd->orient); 810 efl_orientation_set(sd->img, sd->orient);
811 efl_orientation_flip_set(sd->img, sd->flip);
812 } 811 }
813 812
814 if (sd->img) 813 if (sd->img)
@@ -1380,23 +1379,6 @@ _efl_ui_image_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_
1380 return sd->orient; 1379 return sd->orient;
1381} 1380}
1382 1381
1383
1384EOLIAN static void
1385_efl_ui_image_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Flip flip)
1386{
1387 if (sd->edje) return;
1388 if (sd->flip == flip) return;
1389
1390 sd->flip = flip;
1391 _efl_ui_image_sizing_eval(obj);
1392}
1393
1394EOLIAN static Efl_Flip
1395_efl_ui_image_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
1396{
1397 return sd->flip;
1398}
1399
1400/** 1382/**
1401 * Turns on editing through drag and drop and copy and paste. 1383 * Turns on editing through drag and drop and copy and paste.
1402 */ 1384 */
@@ -2134,57 +2116,25 @@ elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable)
2134} 2116}
2135 2117
2136EAPI void 2118EAPI void
2137elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient) 2119elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient elm_orient)
2138{ 2120{
2139 Efl_Orient dir; 2121 // This array takes an Elm_Image_Orient and turns it into an Efl_Orient
2140 Efl_Flip flip; 2122 static const Efl_Orient efl_orient[8] = {
2123 EFL_ORIENT_NONE,
2124 EFL_ORIENT_RIGHT,
2125 EFL_ORIENT_DOWN,
2126 EFL_ORIENT_LEFT,
2127 EFL_ORIENT_FLIP_HORIZONTAL,
2128 EFL_ORIENT_FLIP_VERTICAL,
2129 EFL_ORIENT_LEFT | EFL_ORIENT_FLIP_VERTICAL,
2130 EFL_ORIENT_RIGHT | EFL_ORIENT_FLIP_VERTICAL
2131 };
2141 2132
2142 EFL_UI_IMAGE_CHECK(obj); 2133 EFL_UI_IMAGE_CHECK(obj);
2143 EFL_UI_IMAGE_DATA_GET(obj, sd); 2134 EFL_UI_IMAGE_DATA_GET(obj, sd);
2144 sd->image_orient = orient; 2135 EINA_SAFETY_ON_FALSE_RETURN(elm_orient >= 0 && elm_orient < 8);
2145 2136 sd->image_orient = elm_orient;
2146 switch (orient) 2137 efl_orientation_set(obj, efl_orient[elm_orient]);
2147 {
2148 case EVAS_IMAGE_ORIENT_0:
2149 dir = EFL_ORIENT_0;
2150 flip = EFL_FLIP_NONE;
2151 break;
2152 case EVAS_IMAGE_ORIENT_90:
2153 dir = EFL_ORIENT_90;
2154 flip = EFL_FLIP_NONE;
2155 break;
2156 case EVAS_IMAGE_ORIENT_180:
2157 dir = EFL_ORIENT_180;
2158 flip = EFL_FLIP_NONE;
2159 break;
2160 case EVAS_IMAGE_ORIENT_270:
2161 dir = EFL_ORIENT_270;
2162 flip = EFL_FLIP_NONE;
2163 break;
2164 case EVAS_IMAGE_FLIP_HORIZONTAL:
2165 dir = EFL_ORIENT_0;
2166 flip = EFL_FLIP_HORIZONTAL;
2167 break;
2168 case EVAS_IMAGE_FLIP_VERTICAL:
2169 dir = EFL_ORIENT_0;
2170 flip = EFL_FLIP_VERTICAL;
2171 break;
2172 case EVAS_IMAGE_FLIP_TRANSVERSE:
2173 dir = EFL_ORIENT_270;
2174 flip = EFL_FLIP_HORIZONTAL;
2175 break;
2176 case EVAS_IMAGE_FLIP_TRANSPOSE:
2177 dir = EFL_ORIENT_270;
2178 flip = EFL_FLIP_VERTICAL;
2179 break;
2180 default:
2181 dir = EFL_ORIENT_0;
2182 flip = EFL_FLIP_NONE;
2183 break;
2184 }
2185
2186 efl_orientation_set(obj, dir);
2187 efl_orientation_flip_set(obj, flip);
2188} 2138}
2189 2139
2190EAPI Elm_Image_Orient 2140EAPI Elm_Image_Orient
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index 5202850d36..d4e766e1b6 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -101,7 +101,6 @@ class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.
101 Efl.Gfx.Image.smooth_scale { get; set; } 101 Efl.Gfx.Image.smooth_scale { get; set; }
102 Efl.Gfx.Image.scale_type { get; set; } 102 Efl.Gfx.Image.scale_type { get; set; }
103 Efl.Orientation.orientation { get; set; } 103 Efl.Orientation.orientation { get; set; }
104 Efl.Orientation.flip { get; set; }
105 Efl.Player.playable { get; } 104 Efl.Player.playable { get; }
106 Efl.Player.play { get; set; } 105 Efl.Player.play { get; set; }
107 Efl.Layout.Signal.signal_emit; 106 Efl.Layout.Signal.signal_emit;
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index f8c3f4ac9e..d306608a46 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -623,7 +623,6 @@ _grid_create(Evas_Object *obj)
623 evas_object_image_add(evas_object_evas_get(obj)); 623 evas_object_image_add(evas_object_evas_get(obj));
624 evas_object_image_load_orientation_set(g->grid[tn].img, EINA_TRUE); 624 evas_object_image_load_orientation_set(g->grid[tn].img, EINA_TRUE);
625 efl_orientation_set(g->grid[tn].img, sd->orient); 625 efl_orientation_set(g->grid[tn].img, sd->orient);
626 efl_orientation_flip_set(g->grid[tn].img, sd->flip);
627 evas_object_image_scale_hint_set 626 evas_object_image_scale_hint_set
628 (g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC); 627 (g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
629 evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE); 628 evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE);
@@ -1323,7 +1322,6 @@ _orient_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
1323 } 1322 }
1324 1323
1325 efl_orientation_set(sd->img, sd->orient); 1324 efl_orientation_set(sd->img, sd->orient);
1326 efl_orientation_flip_set(sd->img, sd->flip);
1327 evas_object_image_size_get(sd->img, &iw, &ih); 1325 evas_object_image_size_get(sd->img, &iw, &ih);
1328 sd->size.imw = iw; 1326 sd->size.imw = iw;
1329 sd->size.imh = ih; 1327 sd->size.imh = ih;
@@ -1348,21 +1346,6 @@ _efl_ui_image_zoomable_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED
1348 return sd->orient; 1346 return sd->orient;
1349} 1347}
1350 1348
1351EOLIAN static void
1352_efl_ui_image_zoomable_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Efl_Flip flip)
1353{
1354 if (sd->flip == flip) return;
1355
1356 sd->flip = flip;
1357 _orient_apply(obj, sd);
1358}
1359
1360EOLIAN static Efl_Flip
1361_efl_ui_image_zoomable_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
1362{
1363 return sd->flip;
1364}
1365
1366static void 1349static void
1367_efl_ui_image_zoomable_bar_read_and_update(Eo *obj) 1350_efl_ui_image_zoomable_bar_read_and_update(Eo *obj)
1368{ 1351{
@@ -2074,7 +2057,6 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd,
2074 sd->zoom = 0.0; 2057 sd->zoom = 0.0;
2075 elm_photocam_zoom_set(obj, tz); 2058 elm_photocam_zoom_set(obj, tz);
2076 sd->orient = EFL_ORIENT_NONE; 2059 sd->orient = EFL_ORIENT_NONE;
2077 sd->flip = EFL_FLIP_NONE;
2078 sd->orientation_changed = EINA_FALSE; 2060 sd->orientation_changed = EINA_FALSE;
2079 2061
2080 return 0; 2062 return 0;
@@ -2160,7 +2142,6 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Evas_Load_Error *ret
2160 sd->zoom = 0.0; 2142 sd->zoom = 0.0;
2161 elm_photocam_zoom_set(obj, tz); 2143 elm_photocam_zoom_set(obj, tz);
2162 sd->orient = EFL_ORIENT_NONE; 2144 sd->orient = EFL_ORIENT_NONE;
2163 sd->flip = EFL_FLIP_NONE;
2164 sd->orientation_changed = EINA_FALSE; 2145 sd->orientation_changed = EINA_FALSE;
2165 2146
2166 if (ret) *ret = evas_object_image_load_error_get(sd->img); 2147 if (ret) *ret = evas_object_image_load_error_get(sd->img);
@@ -3191,95 +3172,54 @@ elm_photocam_add(Evas_Object *parent)
3191 return elm_legacy_add(EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS, parent); 3172 return elm_legacy_add(EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS, parent);
3192} 3173}
3193 3174
3194static inline void 3175static inline Efl_Orient
3195_evas_orient_to_eo_orient_flip(const Evas_Image_Orient evas_orient, 3176_evas_orient_to_efl_orient(const Evas_Image_Orient evas_orient)
3196 Efl_Orient *orient, Efl_Flip *flip) 3177{
3197{ 3178 // This array takes an Elm_Image_Orient and turns it into an Efl_Orient
3198 switch (evas_orient) { 3179 static const Efl_Orient efl_orient[8] = {
3199 case EVAS_IMAGE_ORIENT_NONE: 3180 EFL_ORIENT_NONE,
3200 *orient = EFL_ORIENT_NONE; 3181 EFL_ORIENT_RIGHT,
3201 *flip = EFL_FLIP_NONE; 3182 EFL_ORIENT_DOWN,
3202 break; 3183 EFL_ORIENT_LEFT,
3203 case EVAS_IMAGE_ORIENT_90: 3184 EFL_ORIENT_FLIP_HORIZONTAL,
3204 *orient = EFL_ORIENT_90; 3185 EFL_ORIENT_FLIP_VERTICAL,
3205 *flip = EFL_FLIP_NONE; 3186 EFL_ORIENT_LEFT | EFL_ORIENT_FLIP_VERTICAL,
3206 break; 3187 EFL_ORIENT_RIGHT | EFL_ORIENT_FLIP_VERTICAL
3207 case EVAS_IMAGE_ORIENT_180: 3188 };
3208 *orient = EFL_ORIENT_180; 3189 EINA_SAFETY_ON_FALSE_RETURN_VAL(evas_orient >= 0 && evas_orient < 8, EFL_ORIENT_NONE);
3209 *flip = EFL_FLIP_NONE; 3190 return efl_orient[evas_orient];
3210 break;
3211 case EVAS_IMAGE_ORIENT_270:
3212 *orient = EFL_ORIENT_270;
3213 *flip = EFL_FLIP_NONE;
3214 break;
3215 case EVAS_IMAGE_FLIP_HORIZONTAL:
3216 *orient = EFL_ORIENT_NONE;
3217 *flip = EFL_FLIP_HORIZONTAL;
3218 break;
3219 case EVAS_IMAGE_FLIP_VERTICAL:
3220 *orient = EFL_ORIENT_NONE;
3221 *flip = EFL_FLIP_VERTICAL;
3222 break;
3223 case EVAS_IMAGE_FLIP_TRANSVERSE:
3224 *orient = EFL_ORIENT_270;
3225 *flip = EFL_FLIP_HORIZONTAL;
3226 break;
3227 case EVAS_IMAGE_FLIP_TRANSPOSE:
3228 *orient = EFL_ORIENT_270;
3229 *flip = EFL_FLIP_VERTICAL;
3230 break;
3231 default:
3232 *orient = EFL_ORIENT_NONE;
3233 *flip = EFL_FLIP_NONE;
3234 break;
3235 }
3236} 3191}
3237 3192
3238static inline Evas_Image_Orient 3193static inline Evas_Image_Orient
3239_eo_orient_flip_to_evas_orient(Efl_Orient orient, Efl_Flip flip) 3194_efl_orient_to_evas_orient(Efl_Orient efl_orient)
3240{ 3195{
3241 switch (flip) 3196 // This array takes an Efl_Orient and turns it into an Elm_Image_Orient
3242 { 3197 static const Evas_Image_Orient evas_orient[16] = {
3243 default: 3198 EVAS_IMAGE_ORIENT_NONE, // EFL_ORIENT_NONE
3244 case EFL_FLIP_NONE: 3199 EVAS_IMAGE_ORIENT_90, // EFL_ORIENT_RIGHT
3245 switch (orient) 3200 EVAS_IMAGE_ORIENT_180, // EFL_ORIENT_DOWN
3246 { 3201 EVAS_IMAGE_ORIENT_270, // EFL_ORIENT_LEFT
3247 default: 3202 EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_ORIENT_NONE + FLIP_HOR
3248 case EFL_ORIENT_0: return EVAS_IMAGE_ORIENT_0; 3203 EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_ORIENT_RIGHT + FLIP_HOR
3249 case EFL_ORIENT_90: return EVAS_IMAGE_ORIENT_90; 3204 EVAS_IMAGE_FLIP_VERTICAL, // EFL_ORIENT_DOWN + FLIP_HOR
3250 case EFL_ORIENT_180: return EVAS_IMAGE_ORIENT_180; 3205 EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_ORIENT_LEFT + FLIP_HOR
3251 case EFL_ORIENT_270: return EVAS_IMAGE_ORIENT_270; 3206 EVAS_IMAGE_FLIP_VERTICAL, // EFL_ORIENT_NONE + FLIP_VER
3252 } 3207 EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_ORIENT_RIGHT + FLIP_VER
3253 case EFL_FLIP_HORIZONTAL: 3208 EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_ORIENT_DOWN + FLIP_VER
3254 switch (orient) 3209 EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_ORIENT_LEFT + FLIP_VER
3255 { 3210 EVAS_IMAGE_ORIENT_180, // EFL_ORIENT_NONE + FLIP_HOR + FLIP_VER
3256 default: 3211 EVAS_IMAGE_ORIENT_270, // EFL_ORIENT_RIGHT + FLIP_HOR + FLIP_VER
3257 case EFL_ORIENT_0: return EVAS_IMAGE_FLIP_HORIZONTAL; 3212 EVAS_IMAGE_ORIENT_0, // EFL_ORIENT_DOWN + FLIP_HOR + FLIP_VER
3258 case EFL_ORIENT_90: return EVAS_IMAGE_FLIP_TRANSPOSE; 3213 EVAS_IMAGE_ORIENT_90 // EFL_ORIENT_LEFT + FLIP_HOR + FLIP_VER
3259 case EFL_ORIENT_180: return EVAS_IMAGE_FLIP_VERTICAL; 3214 };
3260 case EFL_ORIENT_270: return EVAS_IMAGE_FLIP_TRANSVERSE; 3215 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_orient >= 0 && efl_orient < 16, EVAS_IMAGE_ORIENT_NONE);
3261 } 3216 return evas_orient[efl_orient];
3262 case EFL_FLIP_VERTICAL:
3263 switch (orient)
3264 {
3265 default:
3266 case EFL_ORIENT_0: return EVAS_IMAGE_FLIP_VERTICAL;
3267 case EFL_ORIENT_90: return EVAS_IMAGE_FLIP_TRANSVERSE;
3268 case EFL_ORIENT_180: return EVAS_IMAGE_FLIP_HORIZONTAL;
3269 case EFL_ORIENT_270: return EVAS_IMAGE_FLIP_TRANSPOSE;
3270 }
3271 }
3272} 3217}
3273 3218
3274EAPI void 3219EAPI void
3275elm_photocam_image_orient_set(Eo *obj, Evas_Image_Orient evas_orient) 3220elm_photocam_image_orient_set(Eo *obj, Evas_Image_Orient evas_orient)
3276{ 3221{
3277 Efl_Orient orient; 3222 efl_orientation_set(obj, _evas_orient_to_efl_orient(evas_orient));
3278 Efl_Flip flip;
3279
3280 _evas_orient_to_eo_orient_flip(evas_orient, &orient, &flip);
3281 efl_orientation_set(obj, orient);
3282 efl_orientation_flip_set(obj, flip);
3283} 3223}
3284 3224
3285EAPI Evas_Image_Orient 3225EAPI Evas_Image_Orient
@@ -3287,7 +3227,7 @@ elm_photocam_image_orient_get(const Eo *obj)
3287{ 3227{
3288 ELM_PHOTOCAM_CHECK(obj) EVAS_IMAGE_ORIENT_NONE; 3228 ELM_PHOTOCAM_CHECK(obj) EVAS_IMAGE_ORIENT_NONE;
3289 EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd); 3229 EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd);
3290 return _eo_orient_flip_to_evas_orient(sd->orient, sd->flip); 3230 return _efl_orient_to_evas_orient(sd->orient);
3291} 3231}
3292 3232
3293EAPI Evas_Object* 3233EAPI Evas_Object*
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index fccf57f21c..42cab4661b 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -66,7 +66,6 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom,
66 Efl.File.load; 66 Efl.File.load;
67 Efl.File.file { get; set; } 67 Efl.File.file { get; set; }
68 Efl.Orientation.orientation { get; set; } 68 Efl.Orientation.orientation { get; set; }
69 Efl.Orientation.flip { get; set; }
70 Efl.Layout.Group.group_size_min { get; } 69 Efl.Layout.Group.group_size_min { get; }
71 Efl.Layout.Group.group_size_max { get; } 70 Efl.Layout.Group.group_size_max { get; }
72 Efl.Layout.Signal.signal_callback_add; 71 Efl.Layout.Signal.signal_callback_add;
diff --git a/src/lib/elementary/efl_ui_image_zoomable_private.h b/src/lib/elementary/efl_ui_image_zoomable_private.h
index 7ccbf2553c..7787e30bbb 100644
--- a/src/lib/elementary/efl_ui_image_zoomable_private.h
+++ b/src/lib/elementary/efl_ui_image_zoomable_private.h
@@ -130,7 +130,6 @@ struct _Efl_Ui_Image_Zoomable_Data
130 130
131 Eina_List *grids; 131 Eina_List *grids;
132 Efl_Orient orient; 132 Efl_Orient orient;
133 Efl_Flip flip;
134 133
135 Eina_Bool main_load_pending : 1; 134 Eina_Bool main_load_pending : 1;
136 Eina_Bool longpressed : 1; 135 Eina_Bool longpressed : 1;
diff --git a/src/lib/elementary/efl_ui_widget_image.h b/src/lib/elementary/efl_ui_widget_image.h
index 7a959d4cc6..38afc71f84 100644
--- a/src/lib/elementary/efl_ui_widget_image.h
+++ b/src/lib/elementary/efl_ui_widget_image.h
@@ -66,7 +66,6 @@ struct _Efl_Ui_Image_Data
66 66
67 Elm_Image_Orient image_orient; // to support EAPI 67 Elm_Image_Orient image_orient; // to support EAPI
68 Efl_Orient orient; 68 Efl_Orient orient;
69 Efl_Flip flip;
70 69
71 struct { 70 struct {
72 Ecore_Thread *th; 71 Ecore_Thread *th;
diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo
index c0b9093557..60d3b523d1 100644
--- a/src/lib/evas/canvas/efl_canvas_image_internal.eo
+++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo
@@ -12,7 +12,6 @@ abstract @beta Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Ef
12 Efl.Object.debug_name_override; 12 Efl.Object.debug_name_override;
13 Efl.File_Save.save; 13 Efl.File_Save.save;
14 Efl.Orientation.orientation { get; set; } 14 Efl.Orientation.orientation { get; set; }
15 Efl.Orientation.flip { get; set; }
16 Efl.Gfx.Image.smooth_scale { get; set; } 15 Efl.Gfx.Image.smooth_scale { get; set; }
17 Efl.Gfx.Image.ratio { get; } 16 Efl.Gfx.Image.ratio { get; }
18 Efl.Gfx.Image.border { get; set; } 17 Efl.Gfx.Image.border { get; set; }
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 5a4f3771a2..36b5ce5d65 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -115,7 +115,6 @@ struct _Evas_Image_Data
115 115
116 Efl_Gfx_Image_Scale_Hint scale_hint; 116 Efl_Gfx_Image_Scale_Hint scale_hint;
117 Efl_Gfx_Image_Content_Hint content_hint; 117 Efl_Gfx_Image_Content_Hint content_hint;
118 Efl_Flip flip_value;
119 Efl_Orient orient_value; 118 Efl_Orient orient_value;
120 119
121 struct { 120 struct {
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index dd8041b35a..6bec504038 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -411,57 +411,32 @@ _evas_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orient or
411 evas_object_change(eo_obj, obj); 411 evas_object_change(eo_obj, obj);
412} 412}
413 413
414static Evas_Image_Orient
415_get_image_orient_from_orient_flip(Efl_Orient orient, Efl_Flip flip)
416{
417 switch (orient)
418 {
419 case EFL_ORIENT_0:
420 if (flip == EFL_FLIP_HORIZONTAL)
421 return EVAS_IMAGE_FLIP_HORIZONTAL;
422 else if (flip == EFL_FLIP_VERTICAL)
423 return EVAS_IMAGE_FLIP_VERTICAL;
424 else
425 return EVAS_IMAGE_ORIENT_0;
426
427 case EFL_ORIENT_90:
428 if (flip == EFL_FLIP_HORIZONTAL)
429 return EVAS_IMAGE_FLIP_TRANSPOSE;
430 else if (flip == EFL_FLIP_VERTICAL)
431 return EVAS_IMAGE_FLIP_TRANSVERSE;
432 else
433 return EVAS_IMAGE_ORIENT_90;
434
435 case EFL_ORIENT_180:
436 if (flip == EFL_FLIP_HORIZONTAL)
437 return EVAS_IMAGE_FLIP_VERTICAL;
438 else if (flip == EFL_FLIP_VERTICAL)
439 return EVAS_IMAGE_FLIP_HORIZONTAL;
440 else
441 return EVAS_IMAGE_ORIENT_180;
442
443 case EFL_ORIENT_270:
444 if (flip == EFL_FLIP_HORIZONTAL)
445 return EVAS_IMAGE_FLIP_TRANSVERSE;
446 else if (flip == EFL_FLIP_VERTICAL)
447 return EVAS_IMAGE_FLIP_TRANSPOSE;
448 else
449 return EVAS_IMAGE_ORIENT_270;
450
451 default:
452 return EVAS_IMAGE_ORIENT_NONE;
453 }
454}
455
456EOLIAN static void 414EOLIAN static void
457_efl_canvas_image_internal_efl_orientation_orientation_set(Eo *obj, Evas_Image_Data *o, Efl_Orient dir) 415_efl_canvas_image_internal_efl_orientation_orientation_set(Eo *obj, Evas_Image_Data *o, Efl_Orient efl_orient)
458{ 416{
459 Evas_Image_Orient orient; 417 // This array takes an Efl_Orient and turns it into an Elm_Image_Orient
460 418 static const Evas_Image_Orient evas_orient[16] = {
461 o->orient_value = dir; 419 EVAS_IMAGE_ORIENT_NONE, // EFL_ORIENT_NONE
462 orient = _get_image_orient_from_orient_flip(dir, o->flip_value); 420 EVAS_IMAGE_ORIENT_90, // EFL_ORIENT_RIGHT
421 EVAS_IMAGE_ORIENT_180, // EFL_ORIENT_DOWN
422 EVAS_IMAGE_ORIENT_270, // EFL_ORIENT_LEFT
423 EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_ORIENT_NONE + FLIP_HOR
424 EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_ORIENT_RIGHT + FLIP_HOR
425 EVAS_IMAGE_FLIP_VERTICAL, // EFL_ORIENT_DOWN + FLIP_HOR
426 EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_ORIENT_LEFT + FLIP_HOR
427 EVAS_IMAGE_FLIP_VERTICAL, // EFL_ORIENT_NONE + FLIP_VER
428 EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_ORIENT_RIGHT + FLIP_VER
429 EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_ORIENT_DOWN + FLIP_VER
430 EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_ORIENT_LEFT + FLIP_VER
431 EVAS_IMAGE_ORIENT_180, // EFL_ORIENT_NONE + FLIP_HOR + FLIP_VER
432 EVAS_IMAGE_ORIENT_270, // EFL_ORIENT_RIGHT + FLIP_HOR + FLIP_VER
433 EVAS_IMAGE_ORIENT_0, // EFL_ORIENT_DOWN + FLIP_HOR + FLIP_VER
434 EVAS_IMAGE_ORIENT_90 // EFL_ORIENT_LEFT + FLIP_HOR + FLIP_VER
435 };
436 EINA_SAFETY_ON_FALSE_RETURN(efl_orient >= 0 && efl_orient < 16);
463 437
464 _evas_image_orientation_set(obj, o, orient); 438 o->orient_value = efl_orient;
439 _evas_image_orientation_set(obj, o, evas_orient[efl_orient]);
465} 440}
466 441
467EOLIAN static Efl_Orient 442EOLIAN static Efl_Orient
@@ -471,23 +446,6 @@ _efl_canvas_image_internal_efl_orientation_orientation_get(const Eo *obj EINA_UN
471} 446}
472 447
473EOLIAN static void 448EOLIAN static void
474_efl_canvas_image_internal_efl_orientation_flip_set(Eo *obj, Evas_Image_Data *o, Efl_Flip flip)
475{
476 Evas_Image_Orient orient;
477
478 o->flip_value = flip;
479 orient = _get_image_orient_from_orient_flip(o->orient_value, flip);
480
481 _evas_image_orientation_set(obj, o, orient);
482}
483
484EOLIAN static Efl_Flip
485_efl_canvas_image_internal_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
486{
487 return o->flip_value;
488}
489
490EOLIAN static void
491_efl_canvas_image_internal_efl_object_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Efl_Dbg_Info *root) 449_efl_canvas_image_internal_efl_object_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Efl_Dbg_Info *root)
492{ 450{
493 efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root); 451 efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);