ecore_wl2: Add APIs to get window property.

Summary:
Creates APIs to get property.

+ecore_wl2_window_popup_input_get
+ecore_wl2_window_input_region_get
+ecore_wl2_window_opaque_region_get

ref T8016

Reviewers: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8016

Differential Revision: https://phab.enlightenment.org/D11038
This commit is contained in:
Woochanlee 2020-01-08 07:59:53 -05:00 committed by Christopher Michael
parent 4ea865623d
commit 926cbb98af
2 changed files with 70 additions and 0 deletions

View File

@ -917,6 +917,20 @@ EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha);
*/
EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
/**
* Get the opaque region of the Ecore_Wl2_Window
*
* @param win The window
* @param x The left point of the region.
* @param y The top point of the region.
* @param w The width of the region.
* @param h The height of the region.
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.24
*/
EAPI void ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h);
/**
* Set the input region of the Ecore_Wl2_Window.
*
@ -935,6 +949,20 @@ EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, in
*/
EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
/**
* Get the input region of the Ecore_Wl2_Window.
*
* @param window The window to set the input region of
* @param x The left point of the region.
* @param y The top point of the region.
* @param w The width of the region.
* @param h The height of the region.
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.24
*/
EAPI void ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h);
/**
* Get if a given window is maximized
*
@ -1300,6 +1328,18 @@ EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window);
*/
EAPI void ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input);
/**
* @brief Get the seat for a popup window to be used with grab
*
* @param window The window
*
* @return Returns Ecore_Wl2_Input if the window has an input.
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.24
*/
EAPI Ecore_Wl2_Input *ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window);
/**
* Check if a window has a shell surface - without one it can't be visible.
*

View File

@ -844,6 +844,17 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
window->pending.opaque = EINA_TRUE;
}
EAPI void
ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (x) *x = window->opaque.x;
if (y) *y = window->opaque.y;
if (w) *w = window->opaque.w;
if (h) *h = window->opaque.h;
}
EAPI void
ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
{
@ -893,6 +904,17 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w,
window->pending.input = EINA_TRUE;
}
EAPI void
ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (x) *x = window->input_rect.x;
if (y) *y = window->input_rect.y;
if (w) *w = window->input_rect.w;
if (h) *h = window->input_rect.h;
}
EAPI Eina_Bool
ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window)
{
@ -1117,6 +1139,14 @@ ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *inpu
window->grab = input;
}
EAPI Ecore_Wl2_Input *
ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN(window);
return window->grab;
}
EAPI Ecore_Wl2_Display *
ecore_wl2_window_display_get(const Ecore_Wl2_Window *window)
{