devilhorns pushed a commit to branch master.
commit cf7c9b9d6b9b850b524aed7a3c299aaa9b11c14b
Author: Chris Michael <[email protected]>
Date: Thu Aug 29 09:25:58 2013 +0100
Added functions for setting input and opaque regions on a window.
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/ecore_wayland/ecore_wl_window.c | 82 +++++++++++++++++++++------------
1 file changed, 52 insertions(+), 30 deletions(-)
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c
b/src/lib/ecore_wayland/ecore_wl_window.c
index 03404f4..bb96017 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -124,8 +124,7 @@ ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y)
if (!win) return;
- win->allocation.x = x;
- win->allocation.y = y;
+ ecore_wl_window_update_location(win, x, y);
if (win->shell_surface)
{
@@ -449,39 +448,11 @@ ecore_wl_window_transparent_get(Ecore_Wl_Window *win)
EAPI void
ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
{
- struct wl_region *region = NULL;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
-
- if ((win->allocation.w == w) && (win->allocation.h == h))
- return;
-
win->allocation.w = w;
win->allocation.h = h;
-
- if (!win->surface) return;
-
- if ((!win->transparent) && (!win->alpha))
- {
- region = wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
- wl_region_add(region, win->allocation.x, win->allocation.y,
- win->allocation.w, win->allocation.h);
- wl_surface_set_opaque_region(win->surface, region);
- wl_region_destroy(region);
- }
-
- if ((win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN) ||
- (win->type != ECORE_WL_WINDOW_TYPE_DND))
- {
- region =
- wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
- wl_region_add(region, win->allocation.x, win->allocation.y,
- win->allocation.w, win->allocation.h);
- wl_surface_set_input_region(win->surface, region);
- wl_region_destroy(region);
- }
}
EAPI void
@@ -611,6 +582,57 @@ ecore_wl_window_surface_find(struct wl_surface *surface)
return win;
}
+/* @since 1.8 */
+EAPI void
+ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w,
int h)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+
+ if ((win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN) ||
+ (win->type != ECORE_WL_WINDOW_TYPE_DND))
+ {
+ if ((w > 0) && (h > 0))
+ {
+ struct wl_region *region = NULL;
+
+ region =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(region, x, y, w, h);
+ wl_surface_set_input_region(win->surface, region);
+ wl_region_destroy(region);
+ }
+ else
+ wl_surface_set_input_region(win->surface, NULL);
+ }
+}
+
+/* @since 1.8 */
+EAPI void
+ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w,
int h)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+
+ if ((!win->transparent) && (!win->alpha))
+ {
+ if ((w > 0) && (h > 0))
+ {
+ struct wl_region *region = NULL;
+
+ region =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(region, x, y, w, h);
+ wl_surface_set_opaque_region(win->surface, region);
+ wl_region_destroy(region);
+ }
+ else
+ wl_surface_set_opaque_region(win->surface, NULL);
+ }
+}
+
/* local functions */
static void
_ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface
*shell_surface, unsigned int serial)
--
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk