ecore_wl: add output_find, buffer_transform_set, transform_get functions 10/127310/1
authorBoram Park <boram1288.park@samsung.com>
Fri, 17 Mar 2017 04:37:22 +0000 (13:37 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 27 Apr 2017 04:42:41 +0000 (13:42 +0900)
Change-Id: I3f3c62bfd6ada530914d34533c46fad33966b0d0

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_output.c
src/lib/ecore_wayland/ecore_wl_window.c

index fe5eee9..e9f5d78 100644 (file)
@@ -755,6 +755,9 @@ EAPI struct wl_seat *ecore_wl_input_seat_get(Ecore_Wl_Input *input);
 
 EAPI Eina_Inlist *ecore_wl_outputs_get(void);
 
+EAPI Ecore_Wl_Output * ecore_wl_window_output_find(Ecore_Wl_Window *window);
+EAPI int ecore_wl_output_transform_get(Ecore_Wl_Output *output);
+
 /**
  * @internal
  * @ingroup Ecore_Wl_Input_Group
@@ -922,6 +925,7 @@ EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscr
 EAPI Eina_Bool ecore_wl_window_fullscreen_get(Ecore_Wl_Window *win);
 EAPI void ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent);
 EAPI Eina_Bool ecore_wl_window_transparent_get(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_buffer_transform_set(Ecore_Wl_Window *win, int buffer_transform);
 EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h);
 EAPI void ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y);
 EAPI struct wl_surface *ecore_wl_window_surface_get(Ecore_Wl_Window *win);
index 5d0a597..2484aab 100644 (file)
@@ -533,6 +533,46 @@ ecore_wl_screen_size_get(int *w, int *h)
    if (h) *h = oh;
 }
 
+EAPI Ecore_Wl_Output *
+ecore_wl_window_output_find(Ecore_Wl_Window *window)
+{
+   Ecore_Wl_Output *out;
+   Eina_Inlist *tmp;
+   int x = 0, y = 0;
+
+   ecore_wl_window_geometry_get(window, &x, &y, NULL, NULL);
+
+   EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->outputs, tmp, out)
+     {
+        int ox, oy, ow, oh;
+
+        ox = out->allocation.x;
+        oy = out->allocation.y;
+
+        switch (out->transform)
+          {
+           case WL_OUTPUT_TRANSFORM_90:
+           case WL_OUTPUT_TRANSFORM_270:
+           case WL_OUTPUT_TRANSFORM_FLIPPED_90:
+           case WL_OUTPUT_TRANSFORM_FLIPPED_270:
+             /* Swap width and height */
+             ow = out->allocation.h;
+             oh = out->allocation.w;
+             break;
+           default:
+             ow = out->allocation.w;
+             oh = out->allocation.h;
+             break;
+          }
+
+        if ((x >= ox && x < ow) && (y >= oy && y < oh))
+          return out;
+     }
+
+   return NULL;
+}
+
+
 /* @since 1.2 */
 EAPI void
 ecore_wl_pointer_xy_get(int *x, int *y)
index f511d34..11757f8 100644 (file)
@@ -124,3 +124,11 @@ _ecore_wl_output_del(Ecore_Wl_Output *output)
      eina_inlist_remove(_ecore_wl_disp->outputs, EINA_INLIST_GET(output));
    free(output);
 }
+
+EAPI int
+ecore_wl_output_transform_get(Ecore_Wl_Output *output)
+{
+   if (!output) return 0;
+
+   return output->transform;
+}
index 2b48846..bfe8116 100644 (file)
@@ -902,6 +902,16 @@ ecore_wl_window_transparent_get(Ecore_Wl_Window *win)
 }
 
 EAPI void
+ecore_wl_window_buffer_transform_set(Ecore_Wl_Window *win, int buffer_transform)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!win) return;
+
+   wl_surface_set_buffer_transform(win->surface, buffer_transform);
+}
+
+EAPI void
 ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);