add utility function for clipping shapes to a rect

SVN revision: 14306
This commit is contained in:
Carsten Haitzler 2005-04-23 05:06:18 +00:00
parent 55cfa78e75
commit 6d90182cc1
2 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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)
{