3 #endif /* ifdef HAVE_CONFIG_H */
7 #include "ecore_x_private.h"
10 static int _fixes_available;
12 static int _fixes_major, _fixes_minor;
13 #endif /* ifdef ECORE_XFIXES */
16 _ecore_x_fixes_init(void)
22 LOGFN(__FILE__, __LINE__, __FUNCTION__);
23 if (XFixesQueryVersion(_ecore_x_disp, &_fixes_major, &_fixes_minor))
27 ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
32 #else /* ifdef ECORE_XFIXES */
34 #endif /* ifdef ECORE_XFIXES */
38 /* I don't know what to call this function. */
40 _ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
49 xrect = malloc(sizeof(XRectangle) * num);
53 for (i = 0; i < num; i++)
55 xrect[i].x = rects[i].x;
56 xrect[i].y = rects[i].y;
57 xrect[i].width = rects[i].width;
58 xrect[i].height = rects[i].height;
63 static Ecore_X_Rectangle *
64 _ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
67 Ecore_X_Rectangle *rects;
73 rects = malloc(sizeof(Ecore_X_Rectangle) * num);
77 for (i = 0; i < num; i++)
79 rects[i].x = xrect[i].x;
80 rects[i].y = xrect[i].y;
81 rects[i].width = xrect[i].width;
82 rects[i].height = xrect[i].height;
87 #endif /* ifdef ECORE_XFIXES */
90 ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
95 XFixesSelectSelectionInput (_ecore_x_disp,
96 DefaultRootWindow(_ecore_x_disp),
98 XFixesSetSelectionOwnerNotifyMask |
99 XFixesSelectionWindowDestroyNotifyMask |
100 XFixesSelectionClientCloseNotifyMask);
108 ecore_x_region_new(Ecore_X_Rectangle *rects,
112 Ecore_X_Region region;
115 LOGFN(__FILE__, __LINE__, __FUNCTION__);
116 xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
117 region = XFixesCreateRegion(_ecore_x_disp, xrect, num);
120 #else /* ifdef ECORE_XFIXES */
122 #endif /* ifdef ECORE_XFIXES */
126 ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
129 Ecore_X_Region region;
131 LOGFN(__FILE__, __LINE__, __FUNCTION__);
132 region = XFixesCreateRegionFromBitmap(_ecore_x_disp, bitmap);
134 #else /* ifdef ECORE_XFIXES */
136 #endif /* ifdef ECORE_XFIXES */
140 ecore_x_region_new_from_window(Ecore_X_Window win,
141 Ecore_X_Region_Type type)
144 Ecore_X_Region region;
146 LOGFN(__FILE__, __LINE__, __FUNCTION__);
147 region = XFixesCreateRegionFromWindow(_ecore_x_disp, win, type);
149 #else /* ifdef ECORE_XFIXES */
151 #endif /* ifdef ECORE_XFIXES */
155 ecore_x_region_new_from_gc(Ecore_X_GC gc)
158 Ecore_X_Region region;
160 LOGFN(__FILE__, __LINE__, __FUNCTION__);
161 region = XFixesCreateRegionFromGC(_ecore_x_disp, gc);
163 #else /* ifdef ECORE_XFIXES */
165 #endif /* ifdef ECORE_XFIXES */
169 ecore_x_region_new_from_picture(Ecore_X_Picture picture)
172 Ecore_X_Region region;
174 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175 region = XFixesCreateRegionFromPicture(_ecore_x_disp, picture);
177 #else /* ifdef ECORE_XFIXES */
179 #endif /* ifdef ECORE_XFIXES */
183 ecore_x_region_free(Ecore_X_Region region)
186 LOGFN(__FILE__, __LINE__, __FUNCTION__);
187 XFixesDestroyRegion(_ecore_x_disp, region);
188 #endif /* ifdef ECORE_XFIXES */
192 ecore_x_region_set(Ecore_X_Region region,
193 Ecore_X_Rectangle *rects,
197 XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
198 LOGFN(__FILE__, __LINE__, __FUNCTION__);
199 XFixesSetRegion(_ecore_x_disp, region, xrect, num);
200 #endif /* ifdef ECORE_XFIXES */
204 ecore_x_region_copy(Ecore_X_Region dest,
205 Ecore_X_Region source)
208 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFixesCopyRegion(_ecore_x_disp, dest, source);
210 #endif /* ifdef ECORE_XFIXES */
214 ecore_x_region_combine(Ecore_X_Region dest,
215 Ecore_X_Region source1,
216 Ecore_X_Region source2)
219 LOGFN(__FILE__, __LINE__, __FUNCTION__);
220 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2);
221 #endif /* ifdef ECORE_XFIXES */
225 ecore_x_region_intersect(Ecore_X_Region dest,
226 Ecore_X_Region source1,
227 Ecore_X_Region source2)
230 LOGFN(__FILE__, __LINE__, __FUNCTION__);
231 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2);
232 #endif /* ifdef ECORE_XFIXES */
236 ecore_x_region_subtract(Ecore_X_Region dest,
237 Ecore_X_Region source1,
238 Ecore_X_Region source2)
241 LOGFN(__FILE__, __LINE__, __FUNCTION__);
242 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2);
243 #endif /* ifdef ECORE_XFIXES */
247 ecore_x_region_invert(Ecore_X_Region dest,
248 Ecore_X_Rectangle *bounds,
249 Ecore_X_Region source)
255 LOGFN(__FILE__, __LINE__, __FUNCTION__);
258 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num);
260 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source);
261 #endif /* ifdef ECORE_XFIXES */
265 ecore_x_region_translate(Ecore_X_Region region,
270 LOGFN(__FILE__, __LINE__, __FUNCTION__);
271 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy);
272 #endif /* ifdef ECORE_XFIXES */
276 ecore_x_region_extents(Ecore_X_Region dest,
277 Ecore_X_Region source)
280 LOGFN(__FILE__, __LINE__, __FUNCTION__);
281 XFixesRegionExtents(_ecore_x_disp, dest, source);
282 #endif /* ifdef ECORE_XFIXES */
285 EAPI Ecore_X_Rectangle *
286 ecore_x_region_fetch(Ecore_X_Region region,
288 Ecore_X_Rectangle *bounds){
290 Ecore_X_Rectangle *rects;
291 XRectangle *xrect, xbound;
293 LOGFN(__FILE__, __LINE__, __FUNCTION__);
294 xrect = XFixesFetchRegionAndBounds(_ecore_x_disp, region, num, &xbound);
295 rects = _ecore_x_rectangle_x_to_ecore(xrect, *num);
296 (*bounds).x = xbound.x;
297 (*bounds).y = xbound.y;
298 (*bounds).width = xbound.width;
299 (*bounds).height = xbound.height;
301 #else /* ifdef ECORE_XFIXES */
303 #endif /* ifdef ECORE_XFIXES */
307 ecore_x_region_expand(Ecore_X_Region dest,
308 Ecore_X_Region source,
315 LOGFN(__FILE__, __LINE__, __FUNCTION__);
316 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom);
317 #endif /* ifdef ECORE_XFIXES */
321 ecore_x_region_gc_clip_set(Ecore_X_Region region,
327 LOGFN(__FILE__, __LINE__, __FUNCTION__);
328 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region);
329 #endif /* ifdef ECORE_XFIXES */
333 ecore_x_region_window_shape_set(Ecore_X_Region region,
335 Ecore_X_Shape_Type type,
340 LOGFN(__FILE__, __LINE__, __FUNCTION__);
341 XFixesSetWindowShapeRegion(_ecore_x_disp,
347 #endif /* ifdef ECORE_XFIXES */
351 ecore_x_region_picture_clip_set(Ecore_X_Region region,
352 Ecore_X_Picture picture,
357 LOGFN(__FILE__, __LINE__, __FUNCTION__);
358 XFixesSetPictureClipRegion(_ecore_x_disp,
363 #endif /* ifdef ECORE_XFIXES */