summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-01-08 07:59:53 -0500
committerChristopher Michael <cp.michael@samsung.com>2020-01-08 07:59:53 -0500
commit926cbb98af4757af991e55f7d4f4cd35195a5ff4 (patch)
treeab5a368842a112df066e0d9b5a0b1b4e50eac0d9
parent4ea865623df83b78830dc253bcddd7e64a7810ca (diff)
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
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h40
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c30
2 files changed, 70 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 0631a5fe6d..d6dfaf1d28 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -918,6 +918,20 @@ EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha);
918EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); 918EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
919 919
920/** 920/**
921 * Get the opaque region of the Ecore_Wl2_Window
922 *
923 * @param win The window
924 * @param x The left point of the region.
925 * @param y The top point of the region.
926 * @param w The width of the region.
927 * @param h The height of the region.
928 *
929 * @ingroup Ecore_Wl2_Window_Group
930 * @since 1.24
931 */
932EAPI void ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h);
933
934/**
921 * Set the input region of the Ecore_Wl2_Window. 935 * Set the input region of the Ecore_Wl2_Window.
922 * 936 *
923 * To set an empty region, pass width and height as 0. 937 * To set an empty region, pass width and height as 0.
@@ -936,6 +950,20 @@ EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, in
936EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); 950EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
937 951
938/** 952/**
953 * Get the input region of the Ecore_Wl2_Window.
954 *
955 * @param window The window to set the input region of
956 * @param x The left point of the region.
957 * @param y The top point of the region.
958 * @param w The width of the region.
959 * @param h The height of the region.
960 *
961 * @ingroup Ecore_Wl2_Window_Group
962 * @since 1.24
963 */
964EAPI void ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h);
965
966/**
939 * Get if a given window is maximized 967 * Get if a given window is maximized
940 * 968 *
941 * @param window The window to get the maximized state of 969 * @param window The window to get the maximized state of
@@ -1301,6 +1329,18 @@ EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window);
1301EAPI void ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input); 1329EAPI void ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input);
1302 1330
1303/** 1331/**
1332 * @brief Get the seat for a popup window to be used with grab
1333 *
1334 * @param window The window
1335 *
1336 * @return Returns Ecore_Wl2_Input if the window has an input.
1337 *
1338 * @ingroup Ecore_Wl2_Window_Group
1339 * @since 1.24
1340 */
1341EAPI Ecore_Wl2_Input *ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window);
1342
1343/**
1304 * Check if a window has a shell surface - without one it can't be visible. 1344 * Check if a window has a shell surface - without one it can't be visible.
1305 * 1345 *
1306 * @param The window to check 1346 * @param The window to check
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 0085354d11..21c01c5a70 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -845,6 +845,17 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
845} 845}
846 846
847EAPI void 847EAPI void
848ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h)
849{
850 EINA_SAFETY_ON_NULL_RETURN(window);
851
852 if (x) *x = window->opaque.x;
853 if (y) *y = window->opaque.y;
854 if (w) *w = window->opaque.w;
855 if (h) *h = window->opaque.h;
856}
857
858EAPI void
848ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h) 859ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
849{ 860{
850 int nx = 0, ny = 0, nw = 0, nh = 0; 861 int nx = 0, ny = 0, nw = 0, nh = 0;
@@ -893,6 +904,17 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w,
893 window->pending.input = EINA_TRUE; 904 window->pending.input = EINA_TRUE;
894} 905}
895 906
907EAPI void
908ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h)
909{
910 EINA_SAFETY_ON_NULL_RETURN(window);
911
912 if (x) *x = window->input_rect.x;
913 if (y) *y = window->input_rect.y;
914 if (w) *w = window->input_rect.w;
915 if (h) *h = window->input_rect.h;
916}
917
896EAPI Eina_Bool 918EAPI Eina_Bool
897ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window) 919ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window)
898{ 920{
@@ -1117,6 +1139,14 @@ ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *inpu
1117 window->grab = input; 1139 window->grab = input;
1118} 1140}
1119 1141
1142EAPI Ecore_Wl2_Input *
1143ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window)
1144{
1145 EINA_SAFETY_ON_NULL_RETURN(window);
1146
1147 return window->grab;
1148}
1149
1120EAPI Ecore_Wl2_Display * 1150EAPI Ecore_Wl2_Display *
1121ecore_wl2_window_display_get(const Ecore_Wl2_Window *window) 1151ecore_wl2_window_display_get(const Ecore_Wl2_Window *window)
1122{ 1152{