ecore-wl2: Add API and event for window rotation change prepare
authorChris Michael <cp.michael@samsung.com>
Fri, 9 Jun 2017 14:27:54 +0000 (10:27 -0400)
committerChris Michael <cp.michael@samsung.com>
Fri, 9 Jun 2017 16:30:42 +0000 (12:30 -0400)
@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2.c
src/lib/ecore_wl2/ecore_wl2_window.c

index f3a8ddd..08ae40b 100644 (file)
@@ -276,6 +276,14 @@ typedef struct _Ecore_Wl2_Event_Output_Transform
    int transform, old_transform;
 } Ecore_Wl2_Event_Output_Transform;
 
+typedef struct _Ecore_Wl2_Event_Window_Rotation
+{
+   Ecore_Wl2_Window *window;
+   int rotation, w, h;
+   Eina_Bool resize : 1;
+} Ecore_Wl2_Event_Window_Rotation;
+typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare;
+
 typedef enum _Ecore_Wl2_Window_Type
 {
    ECORE_WL2_WINDOW_TYPE_NONE,
@@ -317,6 +325,7 @@ EAPI extern int ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED; /** @since 1.20 */
 EAPI extern int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED; /** @since 1.20 */
 EAPI extern int ECORE_WL2_EVENT_SEAT_SELECTION; /** @since 1.20 */
 EAPI extern int ECORE_WL2_EVENT_OUTPUT_TRANSFORM; /** @since 1.20 */
+EAPI extern int ECORE_Wl2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE; /** @since 1.20 */
 
 /**
  * @file
@@ -1067,6 +1076,8 @@ EAPI void ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, con
  */
 EAPI Eina_Bool ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int count);
 
+EAPI void ecore_wl2_window_rotation_change_prepare_send(Ecore_Wl2_Window *window, int rot, int w, int h, Eina_Bool resize);
+
 /**
  * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions
  * @ingroup Ecore_Wl2_Group
index fa4a774..01286d8 100644 (file)
@@ -40,6 +40,7 @@ EAPI int ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED = 0;
 EAPI int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = 0;
 EAPI int ECORE_WL2_EVENT_SEAT_SELECTION = 0;
 EAPI int ECORE_WL2_EVENT_OUTPUT_TRANSFORM = 0;
+EAPI int ECORE_Wl2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE = 0;
 
 EAPI int _ecore_wl2_event_window_www = -1;
 EAPI int _ecore_wl2_event_window_www_drag = -1;
@@ -109,6 +110,7 @@ ecore_wl2_init(void)
         ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED = ecore_event_type_new();
         ECORE_WL2_EVENT_SEAT_SELECTION = ecore_event_type_new();
         ECORE_WL2_EVENT_OUTPUT_TRANSFORM = ecore_event_type_new();
+        ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE = ecore_event_type_new();
      }
    if (!no_session_recovery)
      no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY");
@@ -166,7 +168,8 @@ ecore_wl2_shutdown(void)
                           ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED,
                           ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED,
                           ECORE_WL2_EVENT_SEAT_SELECTION,
-                          ECORE_WL2_EVENT_OUTPUT_TRANSFORM);
+                          ECORE_WL2_EVENT_OUTPUT_TRANSFORM,
+                          ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE);
 
    /* shutdown Ecore_Event */
    ecore_event_shutdown();
index 08b56ff..e4ded74 100644 (file)
@@ -1288,3 +1288,22 @@ ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, u
 
    return EINA_FALSE;
 }
+
+EAPI void
+ecore_wl2_window_rotation_change_prepare_send(Ecore_Wl2_Window *window, int rot, int w, int h, Eina_Bool resize)
+{
+   Ecore_Wl2_Event_Window_Rotation_Change_Prepare *ev;
+
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Rotation_Change_Prepare));
+   if (!ev) return;
+
+   ev->window = window;
+   ev->rotation = rot;
+   ev->w = w;
+   ev->h = h;
+   ev->resize = resize;
+
+   ecore_event_add(ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE, ev, NULL, NULL);
+}