3 #endif /* ifdef HAVE_CONFIG_H */
8 #include "ecore_x_private.h"
12 * @defgroup Ecore_X_Window_Shape X Window Shape Functions
14 * These functions use the shape extension of the X server to change
15 * shape of given windows.
19 * Sets the shape of the given window to that given by the pixmap @p mask.
20 * @param win The given window.
21 * @param mask A 2-bit depth pixmap that provides the new shape of the
23 * @ingroup Ecore_X_Window_Shape
26 ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
28 LOGFN(__FILE__, __LINE__, __FUNCTION__);
29 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
30 } /* ecore_x_window_shape_mask_set */
33 ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win)
35 LOGFN(__FILE__, __LINE__, __FUNCTION__);
36 XShapeCombineShape(_ecore_x_disp,
44 } /* ecore_x_window_shape_window_set */
47 ecore_x_window_shape_window_set_xy(Ecore_X_Window win,
48 Ecore_X_Window shape_win,
52 LOGFN(__FILE__, __LINE__, __FUNCTION__);
53 XShapeCombineShape(_ecore_x_disp,
61 } /* ecore_x_window_shape_window_set_xy */
64 ecore_x_window_shape_rectangle_set(Ecore_X_Window win,
72 LOGFN(__FILE__, __LINE__, __FUNCTION__);
77 XShapeCombineRectangles(_ecore_x_disp,
86 } /* ecore_x_window_shape_rectangle_set */
89 ecore_x_window_shape_rectangles_set(Ecore_X_Window win,
90 Ecore_X_Rectangle *rects,
93 XRectangle *rect = NULL;
96 LOGFN(__FILE__, __LINE__, __FUNCTION__);
99 rect = malloc(sizeof(XRectangle) * num);
101 for (i = 0; i < num; i++)
103 rect[i].x = rects[i].x;
104 rect[i].y = rects[i].y;
105 rect[i].width = rects[i].width;
106 rect[i].height = rects[i].height;
112 XShapeCombineRectangles(_ecore_x_disp,
123 } /* ecore_x_window_shape_rectangles_set */
126 ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win)
128 LOGFN(__FILE__, __LINE__, __FUNCTION__);
129 XShapeCombineShape(_ecore_x_disp,
137 } /* ecore_x_window_shape_window_add */
140 ecore_x_window_shape_window_add_xy(Ecore_X_Window win,
141 Ecore_X_Window shape_win,
145 LOGFN(__FILE__, __LINE__, __FUNCTION__);
146 XShapeCombineShape(_ecore_x_disp,
154 } /* ecore_x_window_shape_window_add_xy */
157 ecore_x_window_shape_rectangle_add(Ecore_X_Window win,
165 LOGFN(__FILE__, __LINE__, __FUNCTION__);
170 XShapeCombineRectangles(_ecore_x_disp,
179 } /* ecore_x_window_shape_rectangle_add */
182 ecore_x_window_shape_rectangle_clip(Ecore_X_Window win,
190 LOGFN(__FILE__, __LINE__, __FUNCTION__);
195 XShapeCombineRectangles(_ecore_x_disp,
204 } /* ecore_x_window_shape_rectangle_clip */
207 ecore_x_window_shape_rectangles_add(Ecore_X_Window win,
208 Ecore_X_Rectangle *rects,
211 XRectangle *rect = NULL;
214 LOGFN(__FILE__, __LINE__, __FUNCTION__);
217 rect = malloc(sizeof(XRectangle) * num);
219 for (i = 0; i < num; i++)
221 rect[i].x = rects[i].x;
222 rect[i].y = rects[i].y;
223 rect[i].width = rects[i].width;
224 rect[i].height = rects[i].height;
230 XShapeCombineRectangles(_ecore_x_disp,
241 } /* ecore_x_window_shape_rectangles_add */
243 EAPI Ecore_X_Rectangle *
244 ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
247 Ecore_X_Rectangle *rects = NULL;
250 LOGFN(__FILE__, __LINE__, __FUNCTION__);
251 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeBounding, &num, &ord);
254 rects = malloc(sizeof(Ecore_X_Rectangle) * num);
256 for (i = 0; i < num; i++)
258 rects[i].x = rect[i].x;
259 rects[i].y = rect[i].y;
260 rects[i].width = rect[i].width;
261 rects[i].height = rect[i].height;
271 } /* ecore_x_window_shape_rectangles_get */
274 ecore_x_window_shape_events_select(Ecore_X_Window win, Eina_Bool on)
276 LOGFN(__FILE__, __LINE__, __FUNCTION__);
278 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
280 XShapeSelectInput(_ecore_x_disp, win, 0);
281 } /* ecore_x_window_shape_events_select */
284 * Sets the input shape of the given window to that given by the pixmap @p mask.
285 * @param win The given window.
286 * @param mask A 2-bit depth pixmap that provides the new input shape of the
288 * @ingroup Ecore_X_Window_Shape
291 ecore_x_window_shape_input_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
293 LOGFN(__FILE__, __LINE__, __FUNCTION__);
295 XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet);
296 #else /* ifdef ShapeInput */
297 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
298 #endif /* ifdef ShapeInput */
299 } /* ecore_x_window_shape_input_mask_set */