summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghun Lee <shiin.lee@samsung.com>2014-02-10 22:09:45 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-10 22:09:45 +0900
commit362594cb4bd39c7e514072f38ca1efac469c6f5e (patch)
tree93cfb4efc1c60f9e19fd9976d7e901d9cea57a2f
parent5f7c0d2715c6baa76b3b41a8604fcb3058665ad5 (diff)
elm_win: added the window manager rotation feature and a sample.
Summary: since to control the rotation of application windows by WM, already added related feature in Ecore_Evas. Added related API for it. Reviewers: raster, seoz CC: gwanglim Differential Revision: https://phab.enlightenment.org/D542
-rw-r--r--src/bin/Makefile.am1
-rw-r--r--src/bin/test.c2
-rw-r--r--src/bin/test_win_wm_rotation.c214
-rw-r--r--src/lib/elm_win.c251
-rw-r--r--src/lib/elm_win_eo.h102
-rw-r--r--src/lib/elm_win_legacy.h137
6 files changed, 706 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 312b23c11..3ebd91fdd 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -134,6 +134,7 @@ test_win_inline.c \
134test_win_socket.c \ 134test_win_socket.c \
135test_win_plug.c \ 135test_win_plug.c \
136test_win_state.c \ 136test_win_state.c \
137test_win_wm_rotation.c \
137test.h 138test.h
138 139
139elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \ 140elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
diff --git a/src/bin/test.c b/src/bin/test.c
index 75e806125..bfd029441 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -205,6 +205,7 @@ void test_systray(void *data, Evas_Object *obj, void *event_info);
205void test_win_inline(void *data, Evas_Object *obj, void *event_info); 205void test_win_inline(void *data, Evas_Object *obj, void *event_info);
206void test_win_socket(void *data, Evas_Object *obj, void *event_info); 206void test_win_socket(void *data, Evas_Object *obj, void *event_info);
207void test_win_plug(void *data, Evas_Object *obj, void *event_info); 207void test_win_plug(void *data, Evas_Object *obj, void *event_info);
208void test_win_wm_rotation(void *data, Evas_Object *obj, void *event_info);
208void test_grid(void *data, Evas_Object *obj, void *event_info); 209void test_grid(void *data, Evas_Object *obj, void *event_info);
209void test_glview_simple(void *data, Evas_Object *obj, void *event_info); 210void test_glview_simple(void *data, Evas_Object *obj, void *event_info);
210void test_glview(void *data, Evas_Object *obj, void *event_info); 211void test_glview(void *data, Evas_Object *obj, void *event_info);
@@ -515,6 +516,7 @@ add_tests:
515 ADD_TEST(NULL, "Window / Background", "Window Inline", test_win_inline); 516 ADD_TEST(NULL, "Window / Background", "Window Inline", test_win_inline);
516 ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket); 517 ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket);
517 ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug); 518 ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug);
519 ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation);
518 520
519 //------------------------------// 521 //------------------------------//
520 ADD_TEST(NULL, "Images", "Icon", test_icon); 522 ADD_TEST(NULL, "Images", "Icon", test_icon);
diff --git a/src/bin/test_win_wm_rotation.c b/src/bin/test_win_wm_rotation.c
new file mode 100644
index 000000000..1a3796131
--- /dev/null
+++ b/src/bin/test_win_wm_rotation.c
@@ -0,0 +1,214 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6typedef struct _App_Data App_Data;
7
8struct _App_Data
9{
10 Eina_Bool wm_rot_supported;
11 Eina_List *chs;
12 int available_rots[4];
13 Evas_Object *lb;
14 Evas_Object *rdg;
15};
16
17static void
18_bt_available_rots_set(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
19{
20 Evas_Object *win = data;
21 App_Data *ad = evas_object_data_get(win, "ad");
22 Evas_Object *o;
23 Eina_List *l;
24 const char *str;
25 unsigned int i = 0;
26
27 if (!ad->wm_rot_supported) return;
28
29 EINA_LIST_FOREACH(ad->chs, l, o)
30 {
31 if (!elm_check_state_get(o)) continue;
32 str = elm_object_text_get(o);
33 if (!str) continue;
34 ad->available_rots[i] = atoi(str);
35 i++;
36 }
37
38 elm_win_wm_rotation_available_rotations_set
39 (win, ad->available_rots, i);
40}
41
42static void
43_bt_preferred_rot_set(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
44{
45 Evas_Object *win = (Evas_Object *)(data);
46 App_Data *ad = evas_object_data_get(win, "ad");
47
48 if (!ad->wm_rot_supported) return;
49
50 Evas_Object *rd = elm_radio_selected_object_get(ad->rdg);
51 if (rd)
52 {
53 const char *str = elm_object_text_get(rd);
54 int rot = 0;
55
56 if (!strcmp(str, "Unset"))
57 rot = -1;
58 else
59 rot = atoi(str);
60
61 elm_win_wm_rotation_preferred_rotation_set(win, rot);
62 }
63}
64
65static void
66_win_wm_rotation_changed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
67{
68 Evas_Object *win = data;
69 App_Data *ad = evas_object_data_get(win, "ad");
70 int rot = elm_win_rotation_get(win);
71 char buf[32];
72
73 if (!ad->wm_rot_supported) return;
74
75 eina_convert_itoa(rot, buf);
76 elm_object_text_set(ad->lb, eina_stringshare_add(buf));
77}
78
79static void
80_win_del_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
81{
82 App_Data *ad = evas_object_data_get(obj, "ad");
83 Evas_Object *o;
84
85 if (ad->wm_rot_supported)
86 {
87 EINA_LIST_FREE(ad->chs, o)
88 evas_object_data_del(o, "rotation");
89 }
90
91 free(ad);
92}
93
94void
95test_win_wm_rotation(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
96{
97 App_Data *ad;
98 Evas_Object *win, *bx, *bx2, *lb, *ch, *bt, *en, *rd, *rdg = NULL;
99 int i;
100 char buf[32];
101
102 if (!(ad = calloc(1, sizeof(App_Data)))) return;
103
104 win = elm_win_util_standard_add("wmrotation", "WMRotation");
105 elm_win_autodel_set(win, EINA_TRUE);
106 evas_object_data_set(win, "ad", ad);
107
108 bx = elm_box_add(win);
109 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
110 elm_win_resize_object_add(win, bx);
111
112 lb = elm_label_add(win);
113 elm_object_text_set(lb, "<b>Window manager rotation test</b>");
114 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
115 elm_box_pack_end(bx, lb);
116 evas_object_show(lb);
117
118 ad->wm_rot_supported = elm_win_wm_rotation_supported_get(win);
119 if (ad->wm_rot_supported)
120 {
121 int rots[] = { 0, 90, 270 };
122 elm_win_wm_rotation_available_rotations_set(win, rots, (sizeof(rots) / sizeof(int)));
123 elm_win_wm_rotation_preferred_rotation_set(win, 90);
124
125 bx2 = elm_box_add(win);
126 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
127 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, 0.0);
128 elm_box_align_set(bx2, 0.0, 0.5);
129 elm_box_horizontal_set(bx2, EINA_TRUE);
130 elm_box_pack_end(bx, bx2);
131 evas_object_show(bx2);
132
133 for (i = 0; i < 4; i++)
134 {
135 ch = elm_check_add(win);
136 eina_convert_itoa((i * 90), buf);
137 elm_object_text_set(ch, eina_stringshare_add(buf));
138 evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
139 elm_box_pack_end(bx2, ch);
140 evas_object_show(ch);
141
142 if (i != 2) elm_check_state_set(ch, EINA_TRUE);
143
144 ad->chs = eina_list_append(ad->chs, ch);
145 }
146
147 bt = elm_button_add(win);
148 elm_object_text_set(bt, "Available rotations");
149 evas_object_smart_callback_add(bt, "clicked", _bt_available_rots_set, win);
150 elm_box_pack_end(bx, bt);
151 evas_object_show(bt);
152
153 bx2 = elm_box_add(win);
154 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
155 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, 0.0);
156 elm_box_align_set(bx2, 0.0, 0.5);
157 elm_box_horizontal_set(bx2, EINA_TRUE);
158 elm_box_pack_end(bx, bx2);
159 evas_object_show(bx2);
160
161 for (i = 0; i < 5; i++)
162 {
163 rd = elm_radio_add(win);
164 if (!rdg) rdg = rd;
165 elm_radio_state_value_set(rd, i);
166 elm_radio_group_add(rd, rdg);
167
168 if (i == 0)
169 elm_object_text_set(rd, "Unset");
170 else
171 {
172 eina_convert_itoa(((i - 1) * 90), buf);
173 elm_object_text_set(rd, eina_stringshare_add(buf));
174 }
175
176 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
177 elm_box_pack_end(bx2, rd);
178 evas_object_show(rd);
179 }
180
181 elm_radio_value_set(rdg, 2);
182 ad->rdg = rdg;
183
184 bt = elm_button_add(win);
185 elm_object_text_set(bt, "Preferred rotation");
186 evas_object_smart_callback_add(bt, "clicked", _bt_preferred_rot_set, win);
187 elm_box_pack_end(bx, bt);
188 evas_object_show(bt);
189
190 evas_object_smart_callback_add(win, "wm,rotation,changed", _win_wm_rotation_changed_cb, win);
191 }
192 else
193 printf("Window manager doesn't support rotation\n");
194
195 en = elm_entry_add(win);
196 elm_entry_single_line_set(en, EINA_TRUE);
197 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
198 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
199 elm_box_pack_end(bx, en);
200 evas_object_show(en);
201
202 lb = elm_label_add(win);
203 elm_object_text_set(lb, "N/A");
204 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
205 elm_box_pack_end(bx, lb);
206 evas_object_show(lb);
207 ad->lb = lb;
208
209 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, NULL);
210
211 evas_object_resize(win, 480, 400);
212 evas_object_show(bx);
213 evas_object_show(win);
214}
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 4a143d81c..5ab15bd67 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -145,6 +145,14 @@ struct _Elm_Win_Smart_Data
145 const char **available_list; 145 const char **available_list;
146 unsigned int count; 146 unsigned int count;
147 } profile; 147 } profile;
148 struct
149 {
150 int preferred_rot; /* indicates preferred rotation value, -1 means invalid. */
151 int *rots; /* indicates available rotations */
152 unsigned int count; /* number of elements in available rotations */
153 Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
154 Eina_Bool use : 1; /* set ture when application use window manager rotation. */
155 } wm_rot;
148 156
149 void *trap_data; 157 void *trap_data;
150 158
@@ -186,6 +194,7 @@ static const char SIG_ROTATION_CHANGED[] = "rotation,changed";
186static const char SIG_PROFILE_CHANGED[] = "profile,changed"; 194static const char SIG_PROFILE_CHANGED[] = "profile,changed";
187static const char SIG_FOCUSED[] = "focused"; 195static const char SIG_FOCUSED[] = "focused";
188static const char SIG_UNFOCUSED[] = "unfocused"; 196static const char SIG_UNFOCUSED[] = "unfocused";
197static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
189 198
190static const Evas_Smart_Cb_Description _smart_callbacks[] = { 199static const Evas_Smart_Cb_Description _smart_callbacks[] = {
191 {SIG_DELETE_REQUEST, ""}, 200 {SIG_DELETE_REQUEST, ""},
@@ -207,6 +216,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
207 {SIG_PROFILE_CHANGED, ""}, 216 {SIG_PROFILE_CHANGED, ""},
208 {SIG_FOCUSED, ""}, 217 {SIG_FOCUSED, ""},
209 {SIG_UNFOCUSED, ""}, 218 {SIG_UNFOCUSED, ""},
219 {SIG_WM_ROTATION_CHANGED, ""},
210 {NULL, NULL} 220 {NULL, NULL}
211}; 221};
212 222
@@ -224,6 +234,9 @@ _elm_win_on_resize_obj_changed_size_hints(void *data,
224 Evas *e, 234 Evas *e,
225 Evas_Object *obj, 235 Evas_Object *obj,
226 void *event_info); 236 void *event_info);
237#ifdef HAVE_ELEMENTARY_X
238static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
239#endif
227 240
228EAPI double _elm_startup_time = 0; 241EAPI double _elm_startup_time = 0;
229 242
@@ -989,6 +1002,7 @@ _elm_win_state_change(Ecore_Evas *ee)
989 Eina_Bool ch_fullscreen = EINA_FALSE; 1002 Eina_Bool ch_fullscreen = EINA_FALSE;
990 Eina_Bool ch_maximized = EINA_FALSE; 1003 Eina_Bool ch_maximized = EINA_FALSE;
991 Eina_Bool ch_profile = EINA_FALSE; 1004 Eina_Bool ch_profile = EINA_FALSE;
1005 Eina_Bool ch_wm_rotation = EINA_FALSE;
992 const char *profile; 1006 const char *profile;
993 1007
994 EINA_SAFETY_ON_NULL_RETURN(sd); 1008 EINA_SAFETY_ON_NULL_RETURN(sd);
@@ -1024,6 +1038,15 @@ _elm_win_state_change(Ecore_Evas *ee)
1024 profile = ecore_evas_window_profile_get(sd->ee); 1038 profile = ecore_evas_window_profile_get(sd->ee);
1025 ch_profile = _elm_win_profile_set(sd, profile); 1039 ch_profile = _elm_win_profile_set(sd, profile);
1026 1040
1041 if (sd->wm_rot.use)
1042 {
1043 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1044 {
1045 sd->rot = ecore_evas_rotation_get(sd->ee);
1046 ch_wm_rotation = EINA_TRUE;
1047 }
1048 }
1049
1027 _elm_win_state_eval_queue(); 1050 _elm_win_state_eval_queue();
1028 1051
1029 if ((ch_withdrawn) || (ch_iconified)) 1052 if ((ch_withdrawn) || (ch_iconified))
@@ -1060,6 +1083,17 @@ _elm_win_state_change(Ecore_Evas *ee)
1060 { 1083 {
1061 _elm_win_profile_update(sd); 1084 _elm_win_profile_update(sd);
1062 } 1085 }
1086 if (ch_wm_rotation)
1087 {
1088 evas_object_size_hint_min_set(obj, -1, -1);
1089 evas_object_size_hint_max_set(obj, -1, -1);
1090#ifdef HAVE_ELEMENTARY_X
1091 _elm_win_xwin_update(sd);
1092#endif
1093 elm_widget_orientation_set(obj, sd->rot);
1094 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1095 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1096 }
1063} 1097}
1064 1098
1065static void 1099static void
@@ -3185,6 +3219,9 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
3185 // do nothing 3219 // do nothing
3186 } 3220 }
3187 3221
3222 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3223 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3224
3188 sd->layout = edje_object_add(sd->evas); 3225 sd->layout = edje_object_add(sd->evas);
3189 _elm_theme_object_set(obj, sd->layout, "win", "base", "default"); 3226 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3190 sd->box = evas_object_box_add(sd->evas); 3227 sd->box = evas_object_box_add(sd->evas);
@@ -4561,6 +4598,203 @@ _rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4561 *ret = sd->rot; 4598 *ret = sd->rot;
4562} 4599}
4563 4600
4601EAPI Eina_Bool
4602elm_win_wm_rotation_supported_get(const Evas_Object *obj)
4603{
4604 ELM_WIN_CHECK(obj) EINA_FALSE;
4605 Eina_Bool ret = EINA_FALSE;
4606 eo_do((Eo *) obj, elm_obj_win_wm_rotation_supported_get(&ret));
4607 return ret;
4608}
4609
4610static void
4611_wm_rotation_supported_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4612{
4613 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4614 Elm_Win_Smart_Data *sd = _pd;
4615 *ret = sd->wm_rot.wm_supported;
4616}
4617
4618/* This will unset a preferred rotation, if given preferred rotation is '-1'.
4619 */
4620EAPI void
4621elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4622 int rotation)
4623{
4624 ELM_WIN_CHECK(obj);
4625 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4626}
4627
4628static void
4629_wm_preferred_rotation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4630{
4631 int rotation = va_arg(*list, int);
4632 int rot;
4633 Elm_Win_Smart_Data *sd = _pd;
4634
4635 if (!sd->wm_rot.use)
4636 sd->wm_rot.use = EINA_TRUE;
4637
4638 // '-1' means that elm_win doesn't use preferred rotation.
4639 if (rotation == -1)
4640 rot = -1;
4641 else
4642 rot = _win_rotation_degree_check(rotation);
4643
4644 if (sd->wm_rot.preferred_rot == rot) return;
4645 sd->wm_rot.preferred_rot = rot;
4646
4647 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4648}
4649
4650EAPI int
4651elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
4652{
4653 ELM_WIN_CHECK(obj) -1;
4654 int ret = -1;
4655 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_get(&ret));
4656 return ret;
4657}
4658
4659static void
4660_wm_preferred_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4661{
4662 int *ret = va_arg(*list, int *);
4663 Elm_Win_Smart_Data *sd = _pd;
4664 *ret = sd->wm_rot.preferred_rot;
4665}
4666
4667EAPI void
4668elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
4669 const int *rotations,
4670 unsigned int count)
4671{
4672 ELM_WIN_CHECK(obj);
4673 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_set(rotations, count));
4674}
4675
4676static void
4677_wm_available_rotations_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4678{
4679 const int *rotations = va_arg(*list, const int *);
4680 unsigned int count = va_arg(*list, unsigned int);
4681 Elm_Win_Smart_Data *sd = _pd;
4682 unsigned int i;
4683 int r;
4684
4685 if (!sd->wm_rot.use)
4686 sd->wm_rot.use = EINA_TRUE;
4687
4688 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4689 sd->wm_rot.count = 0;
4690
4691 if (count > 0)
4692 {
4693 sd->wm_rot.rots = calloc(count, sizeof(int));
4694 if (!sd->wm_rot.rots) return;
4695 for (i = 0; i < count; i++)
4696 {
4697 r = _win_rotation_degree_check(rotations[i]);
4698 sd->wm_rot.rots[i] = r;
4699 }
4700 }
4701
4702 sd->wm_rot.count = count;
4703
4704 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4705 sd->wm_rot.rots,
4706 sd->wm_rot.count);
4707}
4708
4709EAPI Eina_Bool
4710elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
4711 int **rotations,
4712 unsigned int *count)
4713{
4714 ELM_WIN_CHECK(obj) EINA_FALSE;
4715 Eina_Bool ret = EINA_FALSE;
4716 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_get(rotations, count, &ret));
4717 return ret;
4718}
4719
4720static void
4721_wm_available_rotations_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4722{
4723 int **rotations = va_arg(*list, int **);
4724 unsigned int *count = va_arg(*list, unsigned int *);
4725 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4726 Elm_Win_Smart_Data *sd = _pd;
4727 *ret = EINA_FALSE;
4728 if (!sd->wm_rot.use) return;
4729
4730 if (sd->wm_rot.count > 0)
4731 {
4732 if (rotations)
4733 {
4734 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4735 if (*rotations)
4736 {
4737 memcpy(*rotations,
4738 sd->wm_rot.rots,
4739 sizeof(int) * sd->wm_rot.count);
4740 }
4741 }
4742 }
4743
4744 if (count) *count = sd->wm_rot.count;
4745 *ret = EINA_TRUE;
4746}
4747
4748EAPI void
4749elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj,
4750 Eina_Bool set)
4751{
4752 ELM_WIN_CHECK(obj);
4753 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_set(set));
4754}
4755
4756static void
4757_wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4758{
4759 int set = va_arg(*list, int);
4760 Elm_Win_Smart_Data *sd = _pd;
4761 if (!sd->wm_rot.use) return;
4762 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4763}
4764
4765EAPI Eina_Bool
4766elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
4767{
4768 ELM_WIN_CHECK(obj) EINA_FALSE;
4769 Eina_Bool ret = EINA_FALSE;
4770 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_get(&ret));
4771 return ret;
4772}
4773
4774static void
4775_wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4776{
4777 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4778 Elm_Win_Smart_Data *sd = _pd;
4779 if (!sd->wm_rot.use) return;
4780 *ret = ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4781}
4782
4783EAPI void
4784elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
4785{
4786 ELM_WIN_CHECK(obj);
4787 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done());
4788}
4789
4790static void
4791_wm_manual_rotation_done(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
4792{
4793 Elm_Win_Smart_Data *sd = _pd;
4794 if (!sd->wm_rot.use) return;
4795 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4796}
4797
4564EAPI void 4798EAPI void
4565elm_win_sticky_set(Evas_Object *obj, 4799elm_win_sticky_set(Evas_Object *obj,
4566 Eina_Bool sticky) 4800 Eina_Bool sticky)
@@ -5701,6 +5935,15 @@ _class_constructor(Eo_Class *klass)
5701 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get), 5935 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
5702 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get), 5936 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
5703 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get), 5937 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get),
5938 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), _wm_rotation_supported_get),
5939 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), _wm_preferred_rotation_set),
5940 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), _wm_preferred_rotation_get),
5941 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), _wm_available_rotations_set),
5942 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), _wm_available_rotations_get),
5943 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), _wm_manual_rotation_done_set),
5944 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), _wm_manual_rotation_done_get),
5945 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE), _wm_manual_rotation_done),
5946
5704 EO_OP_FUNC_SENTINEL 5947 EO_OP_FUNC_SENTINEL
5705 }; 5948 };
5706 5949
@@ -5805,6 +6048,14 @@ static const Eo_Op_Description op_desc[] = {
5805 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."), 6048 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
5806 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."), 6049 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."),
5807 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."), 6050 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."),
6051 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET, "Query if the underlying windowing system supports the window manager rotation.."),
6052 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET, "Set the preferred rotation hint."),
6053 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET, "Get the preferred rotation hint."),
6054 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET, "Set the array of available window rotations."),
6055 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET, "Get the array of available window rotations."),
6056 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET, "Set manual rotation done mode of obj window."),
6057 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET, "Get manual rotation done mode of obj window."),
6058 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE, "Set rotation finish manually"),
5808 EO_OP_DESCRIPTION_SENTINEL 6059 EO_OP_DESCRIPTION_SENTINEL
5809}; 6060};
5810 6061
diff --git a/src/lib/elm_win_eo.h b/src/lib/elm_win_eo.h
index 8ccc90190..ae679092d 100644
--- a/src/lib/elm_win_eo.h
+++ b/src/lib/elm_win_eo.h
@@ -106,6 +106,14 @@ enum
106 ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, 106 ELM_OBJ_WIN_SUB_ID_XWINDOW_GET,
107 ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, 107 ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET,
108 ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, 108 ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET,
109 ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET,
110 ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET,
111 ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET,
112 ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET,
113 ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET,
114 ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET,
115 ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET,
116 ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE,
109 ELM_OBJ_WIN_SUB_ID_LAST 117 ELM_OBJ_WIN_SUB_ID_LAST
110 }; 118 };
111 119
@@ -1269,6 +1277,98 @@ enum
1269#define elm_obj_win_window_id_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), EO_TYPECHECK(Ecore_Window *, ret) 1277#define elm_obj_win_window_id_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), EO_TYPECHECK(Ecore_Window *, ret)
1270 1278
1271/** 1279/**
1272 * @} 1280 * @def elm_obj_win_wm_rotation_supported_get
1281 * @since 1.9
1282 *
1283 * Query whether window manager supports window rotation or not.
1284 *
1285 * @param[out] ret
1286 *
1287 * @see elm_win_wm_rotation_supported_get
1288 */
1289#define elm_obj_win_wm_rotation_supported_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), EO_TYPECHECK(Eina_Bool *, ret)
1290
1291/**
1292 * @def elm_obj_win_wm_preferred_rotation_set
1293 * @since 1.9
1294 *
1295 * Set the preferred rotation value.
1296 *
1297 * @param[in] rotation
1298 *
1299 * @see elm_win_wm_rotation_preferred_rotation_set
1300 */
1301#define elm_obj_win_wm_preferred_rotation_set(rotation) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), EO_TYPECHECK(int, rotation)
1302
1303/**
1304 * @def elm_obj_win_wm_preferred_rotation_get
1305 * @since 1.9
1306 *
1307 * Get the preferred rotation value.
1308 *
1309 * @param[out] ret
1310 *
1311 * @see elm_win_wm_rotation_preferred_rotation_get
1312 */
1313#define elm_obj_win_wm_preferred_rotation_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), EO_TYPECHECK(int *, ret)
1314
1315/**
1316 * @def elm_obj_win_wm_available_rotations_set
1317 * @since 1.9
1318 *
1319 * Set the array of available rotations.
1320 *
1321 * @param[in] rotations
1322 * @param[in] count
1323 *
1324 * @see elm_win_wm_rotation_available_rotations_set
1273 */ 1325 */
1326#define elm_obj_win_wm_available_rotations_set(rotation, count) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), EO_TYPECHECK(const int *, rotations), EO_TYPECHECK(unsigned int, count)
1274 1327
1328/**
1329 * @def elm_obj_win_wm_available_rotations_get
1330 * @since 1.9
1331 *
1332 * Get the array of available window rotation value.
1333 *
1334 * @param[out] rotations
1335 * @param[out] count
1336 * @param[out] ret
1337 *
1338 * @see elm_win_wm_rotation_available_rotations_get
1339 */
1340#define elm_obj_win_wm_available_rotations_get(rotations, count, ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), EO_TYPECHECK(int **, rotations), EO_TYPECHECK(unsigned int *, count), EO_TYPECHECK(Eina_Bool *, ret)
1341
1342/**
1343 * @def elm_obj_win_wm_manual_rotation_done_set
1344 * @since 1.9
1345 *
1346 * Set manual rotation done mode
1347 *
1348 * @param[in] set
1349 *
1350 * @see elm_win_wm_rotation_manual_rotation_done_set
1351 */
1352#define elm_obj_win_wm_manual_rotation_done_set(set) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), EO_TYPECHECK(Eina_Bool, set)
1353
1354/**
1355 * @def elm_obj_win_wm_manual_rotation_done_get
1356 * @since 1.9
1357 *
1358 * Get manual rotation done mode state
1359 *
1360 * @param[out] ret
1361 *
1362 * @see elm_win_wm_rotation_manual_rotation_done_get
1363 */
1364#define elm_obj_win_wm_manual_rotation_done_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), EO_TYPECHECK(Eina_Bool *, ret)
1365
1366/**
1367 * @def elm_obj_win_wm_manual_rotation_done
1368 * @since 1.9
1369 *
1370 * Set rotation finish manually
1371 *
1372 * @see elm_win_wm_rotation_manual_rotation_done
1373 */
1374#define elm_obj_win_wm_manual_rotation_done() ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE)
diff --git a/src/lib/elm_win_legacy.h b/src/lib/elm_win_legacy.h
index 2a31c010d..2513357ab 100644
--- a/src/lib/elm_win_legacy.h
+++ b/src/lib/elm_win_legacy.h
@@ -841,6 +841,143 @@ EAPI void elm_win_rotation_with_resize_set(Evas_Object *obj, in
841EAPI int elm_win_rotation_get(const Evas_Object *obj); 841EAPI int elm_win_rotation_get(const Evas_Object *obj);
842 842
843/** 843/**
844 * Query whether window manager supports window rotation or not.
845 *
846 * The window manager rotation allows the WM to controls the rotation of application windows.
847 * It is designed to support synchronized rotation for the multiple application windows at same time.
848 *
849 * @return @c EINA_TRUE if the window manager rotation is supported, @c EINA_FALSE otherwise.
850 *
851 * @see elm_win_wm_rotation_supported_get()
852 * @see elm_win_wm_rotation_preferred_rotation_set()
853 * @see elm_win_wm_rotation_preferred_rotation_get()
854 * @see elm_win_wm_rotation_available_rotations_set()
855 * @see elm_win_wm_rotation_available_rotations_get()
856 * @see elm_win_wm_rotation_manual_rotation_done_set()
857 * @see elm_win_wm_rotation_manual_rotation_done_get()
858 * @see elm_win_wm_rotation_manual_rotation_done()
859 *
860 * @ingroup Win
861 * @since 1.9
862 */
863EAPI Eina_Bool elm_win_wm_rotation_supported_get(const Evas_Object *obj);
864
865/**
866 * Set the preferred rotation value.
867 *
868 * This function is used to set the orientation of window @p obj to spicific angle fixed.
869 *
870 * @param obj The window object
871 * @param rotation The preferred rotation of the window in degrees (0-360),
872 * counter-clockwise.
873 *
874 * @see elm_win_wm_rotation_preferred_rotation_get()
875 *
876 * ingroup Win
877 * @since 1.9
878 */
879EAPI void elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj, int rotation);
880
881/**
882 * Get the preferred rotation value.
883 *
884 * This function is used to get the preferred rotoation value.
885 *
886 * @param obj The window object
887 * @return The preferred rotation of the window in degrees (0-360),
888 * counter-clockwise.
889 *
890 * @see elm_win_wm_rotation_preferred_rotation_set()
891 *
892 * ingroup Win
893 * @since 1.9
894 */
895EAPI int elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj);
896
897/**
898 * Set the array of available window rotations.
899 *
900 * This function is used to set the available rotations to give the hints to WM.
901 * WM will refer this hints and set the orientation window properly.
902 *
903 * @param obj The window object
904 * @param *rotations The array of rotation value.
905 * @param count The number of array of rotations
906 *
907 * @see elm_win_wm_rotation_available_rotations_get()
908 *
909 * ingroup Win
910 * @since 1.9
911 */
912EAPI void elm_win_wm_rotation_available_rotations_set(Evas_Object *obj, const int *rotations, unsigned int count);
913
914/**
915 * Get the array of available window rotations.
916 *
917 * This function is used to get the available rotations.
918 *
919 * @param obj The window object
920 * @param rotations To store the available rotations.
921 * @param count To store the number of rotations.
922 *
923 * @see elm_win_wm_rotation_available_rotations_set()
924 *
925 * ingroup Win
926 * @since 1.9
927 */
928EAPI Eina_Bool elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj, int **rotations, unsigned int *count);
929
930/**
931 * Set the manual rotation done mode.
932 *
933 * This function is used to set or reset the manual rotation done mode.
934 * the message of rotation done is sent to WM after rendering its canvas in Ecore_Evas.
935 * but if set the manual rotation done mode,
936 * it's disabled and user should call the "elm_win_wm_rotation_manual_done" explicitly to sends the message.
937 *
938 * @param obj The window object
939 * @param set EINA_TRUE means to set manual rotation done mode EINA_FALSE otherwise.
940 *
941 * @see elm_win_wm_rotation_manual_rotation_done_get()
942 * @see elm_win_wm_rotation_manual_rotation_done()
943 *
944 * ingroup Win
945 * @since 1.9
946 */
947EAPI void elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj, Eina_Bool set);
948
949/**
950 * Get the state of manual rotation done mode.
951 *
952 * This function is used to get the state of manual rotation done mode.
953 *
954 * @param obj The window object
955 * @return @c EINA_TRUE manual rotationn done mode, @c EINA_FALSE otherwise.
956 *
957 * @see elm_win_wm_rotation_manual_rotation_done_set()
958 * @see elm_win_wm_rotation_manual_rotation_done()
959 *
960 * ingroup Win
961 * @since 1.9
962 */
963EAPI Eina_Bool elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj);
964
965/**
966 * To notify the rotation done to WM manually.
967 *
968 * This function is used to notify the rotation done to WM manually.
969 *
970 * @param obj The window object
971 *
972 * @see elm_win_wm_rotation_manual_rotation_done_set()
973 * @see elm_win_wm_rotation_manual_rotation_done_get()
974 *
975 * ingroup Win
976 * @since 1.9
977 */
978EAPI void elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj);
979
980/**
844 * Set the sticky state of the window. 981 * Set the sticky state of the window.
845 * 982 *
846 * Hints the Window Manager that the window in @p obj should be left fixed 983 * Hints the Window Manager that the window in @p obj should be left fixed