ecore-wl2: Add API and event for window rotation change prepare

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-06-09 10:27:54 -04:00
parent 9930929dbb
commit 92d214d8f9
3 changed files with 34 additions and 1 deletions

View 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

View 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();

View 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);
}