summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-09 10:27:54 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-09 12:30:42 -0400
commit92d214d8f908c6468fd2262cb0fece507a581873 (patch)
tree6a071e241a723db96b549272a7a4e10728284516 /src/lib
parent9930929dbba5436ce5e408ecf1bac2893f1ab3be (diff)
ecore-wl2: Add API and event for window rotation change prepare
@feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h11
-rw-r--r--src/lib/ecore_wl2/ecore_wl2.c5
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c19
3 files changed, 34 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index f3a8ddd402..08ae40b19d 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -276,6 +276,14 @@ typedef struct _Ecore_Wl2_Event_Output_Transform
276 int transform, old_transform; 276 int transform, old_transform;
277} Ecore_Wl2_Event_Output_Transform; 277} Ecore_Wl2_Event_Output_Transform;
278 278
279typedef struct _Ecore_Wl2_Event_Window_Rotation
280{
281 Ecore_Wl2_Window *window;
282 int rotation, w, h;
283 Eina_Bool resize : 1;
284} Ecore_Wl2_Event_Window_Rotation;
285typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare;
286
279typedef enum _Ecore_Wl2_Window_Type 287typedef enum _Ecore_Wl2_Window_Type
280{ 288{
281 ECORE_WL2_WINDOW_TYPE_NONE, 289 ECORE_WL2_WINDOW_TYPE_NONE,
@@ -317,6 +325,7 @@ EAPI extern int ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED; /** @since 1.20 */
317EAPI extern int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED; /** @since 1.20 */ 325EAPI extern int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED; /** @since 1.20 */
318EAPI extern int ECORE_WL2_EVENT_SEAT_SELECTION; /** @since 1.20 */ 326EAPI extern int ECORE_WL2_EVENT_SEAT_SELECTION; /** @since 1.20 */
319EAPI extern int ECORE_WL2_EVENT_OUTPUT_TRANSFORM; /** @since 1.20 */ 327EAPI extern int ECORE_WL2_EVENT_OUTPUT_TRANSFORM; /** @since 1.20 */
328EAPI extern int ECORE_Wl2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE; /** @since 1.20 */
320 329
321/** 330/**
322 * @file 331 * @file
@@ -1067,6 +1076,8 @@ EAPI void ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, con
1067 */ 1076 */
1068EAPI Eina_Bool ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int count); 1077EAPI Eina_Bool ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int count);
1069 1078
1079EAPI void ecore_wl2_window_rotation_change_prepare_send(Ecore_Wl2_Window *window, int rot, int w, int h, Eina_Bool resize);
1080
1070/** 1081/**
1071 * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions 1082 * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions
1072 * @ingroup Ecore_Wl2_Group 1083 * @ingroup Ecore_Wl2_Group
diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c
index fa4a7747b8..01286d88fd 100644
--- a/src/lib/ecore_wl2/ecore_wl2.c
+++ b/src/lib/ecore_wl2/ecore_wl2.c
@@ -40,6 +40,7 @@ EAPI int ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED = 0;
40EAPI int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = 0; 40EAPI int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = 0;
41EAPI int ECORE_WL2_EVENT_SEAT_SELECTION = 0; 41EAPI int ECORE_WL2_EVENT_SEAT_SELECTION = 0;
42EAPI int ECORE_WL2_EVENT_OUTPUT_TRANSFORM = 0; 42EAPI int ECORE_WL2_EVENT_OUTPUT_TRANSFORM = 0;
43EAPI int ECORE_Wl2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE = 0;
43 44
44EAPI int _ecore_wl2_event_window_www = -1; 45EAPI int _ecore_wl2_event_window_www = -1;
45EAPI int _ecore_wl2_event_window_www_drag = -1; 46EAPI int _ecore_wl2_event_window_www_drag = -1;
@@ -109,6 +110,7 @@ ecore_wl2_init(void)
109 ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = ecore_event_type_new(); 110 ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = ecore_event_type_new();
110 ECORE_WL2_EVENT_SEAT_SELECTION = ecore_event_type_new(); 111 ECORE_WL2_EVENT_SEAT_SELECTION = ecore_event_type_new();
111 ECORE_WL2_EVENT_OUTPUT_TRANSFORM = ecore_event_type_new(); 112 ECORE_WL2_EVENT_OUTPUT_TRANSFORM = ecore_event_type_new();
113 ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE = ecore_event_type_new();
112 } 114 }
113 if (!no_session_recovery) 115 if (!no_session_recovery)
114 no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY"); 116 no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY");
@@ -166,7 +168,8 @@ ecore_wl2_shutdown(void)
166 ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED, 168 ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED,
167 ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, 169 ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED,
168 ECORE_WL2_EVENT_SEAT_SELECTION, 170 ECORE_WL2_EVENT_SEAT_SELECTION,
169 ECORE_WL2_EVENT_OUTPUT_TRANSFORM); 171 ECORE_WL2_EVENT_OUTPUT_TRANSFORM,
172 ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE);
170 173
171 /* shutdown Ecore_Event */ 174 /* shutdown Ecore_Event */
172 ecore_event_shutdown(); 175 ecore_event_shutdown();
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 08b56ffe08..e4ded74569 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1288,3 +1288,22 @@ ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, u
1288 1288
1289 return EINA_FALSE; 1289 return EINA_FALSE;
1290} 1290}
1291
1292EAPI void
1293ecore_wl2_window_rotation_change_prepare_send(Ecore_Wl2_Window *window, int rot, int w, int h, Eina_Bool resize)
1294{
1295 Ecore_Wl2_Event_Window_Rotation_Change_Prepare *ev;
1296
1297 EINA_SAFETY_ON_NULL_RETURN(window);
1298
1299 ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare));
1300 if (!ev) return;
1301
1302 ev->window = window;
1303 ev->rotation = rot;
1304 ev->w = w;
1305 ev->h = h;
1306 ev->resize = resize;
1307
1308 ecore_event_add(ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE, ev, NULL, NULL);
1309}