From 6d90182cc164a2a456a50a55c969eb3d8efdcc51 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 23 Apr 2005 05:06:18 +0000 Subject: [PATCH] add utility function for clipping shapes to a rect SVN revision: 14306 --- legacy/ecore/src/lib/ecore_x/Ecore_X.h | 1 + legacy/ecore/src/lib/ecore_x/ecore_x_window_shape.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index d71258d893..91fdba1224 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -986,6 +986,7 @@ EAPI void ecore_x_window_shape_rectangles_set(Ecore_X_Window win, EAPI void ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win); EAPI void ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y); EAPI void ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h); +EAPI void ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, int x, int y, int w, int h); EAPI void ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num); EAPI Ecore_X_Rectangle *ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret); EAPI void ecore_x_window_shape_events_select(Ecore_X_Window win, int on); diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_window_shape.c b/legacy/ecore/src/lib/ecore_x/ecore_x_window_shape.c index 23a8f39993..27ea707aa8 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_window_shape.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_window_shape.c @@ -90,6 +90,18 @@ ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeUnion, Unsorted); } +void +ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, int x, int y, int w, int h) +{ + XRectangle rect; + + rect.x = x; + rect.y = y; + rect.width = w; + rect.height = h; + XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeIntersect, Unsorted); +} + void ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num) {