2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
12 #include "ecore_x_private.h"
16 * @defgroup Ecore_X_Window_Shape X Window Shape Functions
18 * These functions use the shape extension of the X server to change
19 * shape of given windows.
23 * Sets the shape of the given window to that given by the pixmap @p mask.
24 * @param win The given window.
25 * @param mask A 2-bit depth pixmap that provides the new shape of the
27 * @ingroup Ecore_X_Window_Shape
30 ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
32 LOGFN(__FILE__, __LINE__, __FUNCTION__);
33 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
37 ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win)
39 LOGFN(__FILE__, __LINE__, __FUNCTION__);
40 XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeSet);
44 ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y)
46 LOGFN(__FILE__, __LINE__, __FUNCTION__);
47 XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeSet);
51 ecore_x_window_shape_rectangle_set(Ecore_X_Window win, int x, int y, int w, int h)
55 LOGFN(__FILE__, __LINE__, __FUNCTION__);
60 XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, Unsorted);
64 ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
66 XRectangle *rect = NULL;
69 LOGFN(__FILE__, __LINE__, __FUNCTION__);
72 rect = malloc(sizeof(XRectangle) * num);
75 for (i = 0; i < num; i++)
77 rect[i].x = rects[i].x;
78 rect[i].y = rects[i].y;
79 rect[i].width = rects[i].width;
80 rect[i].height = rects[i].height;
86 XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, rect, num, ShapeSet, Unsorted);
91 ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win)
93 LOGFN(__FILE__, __LINE__, __FUNCTION__);
94 XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeUnion);
98 ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y)
100 LOGFN(__FILE__, __LINE__, __FUNCTION__);
101 XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeUnion);
105 ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h)
109 LOGFN(__FILE__, __LINE__, __FUNCTION__);
114 XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeUnion, Unsorted);
118 ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, int x, int y, int w, int h)
122 LOGFN(__FILE__, __LINE__, __FUNCTION__);
127 XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeIntersect, Unsorted);
131 ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
133 XRectangle *rect = NULL;
136 LOGFN(__FILE__, __LINE__, __FUNCTION__);
139 rect = malloc(sizeof(XRectangle) * num);
142 for (i = 0; i < num; i++)
144 rect[i].x = rects[i].x;
145 rect[i].y = rects[i].y;
146 rect[i].width = rects[i].width;
147 rect[i].height = rects[i].height;
153 XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, rect, num, ShapeUnion, Unsorted);
154 if (rect) free(rect);
157 EAPI Ecore_X_Rectangle *
158 ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
161 Ecore_X_Rectangle *rects = NULL;
164 LOGFN(__FILE__, __LINE__, __FUNCTION__);
165 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeBounding, &num, &ord);
168 rects = malloc(sizeof(Ecore_X_Rectangle) * num);
171 for (i = 0; i < num; i++)
173 rects[i].x = rect[i].x;
174 rects[i].y = rect[i].y;
175 rects[i].width = rect[i].width;
176 rects[i].height = rect[i].height;
181 if (num_ret) *num_ret = num;
186 ecore_x_window_shape_events_select(Ecore_X_Window win, int on)
188 LOGFN(__FILE__, __LINE__, __FUNCTION__);
190 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
192 XShapeSelectInput(_ecore_x_disp, win, 0);
196 * Sets the input shape of the given window to that given by the pixmap @p mask.
197 * @param win The given window.
198 * @param mask A 2-bit depth pixmap that provides the new input shape of the
200 * @ingroup Ecore_X_Window_Shape
203 ecore_x_window_shape_input_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
205 LOGFN(__FILE__, __LINE__, __FUNCTION__);
207 XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet);
209 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);