aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c365
1 files changed, 0 insertions, 365 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
deleted file mode 100644
index da0a6c3..0000000
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
+++ /dev/null
@@ -1,365 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */
4
5#include <stdlib.h>
6
7#include "ecore_x_private.h"
8#include "Ecore_X.h"
9
10static int _fixes_available;
11#ifdef ECORE_XFIXES
12static int _fixes_major, _fixes_minor;
13#endif /* ifdef ECORE_XFIXES */
14
15void
16_ecore_x_fixes_init(void)
17{
18#ifdef ECORE_XFIXES
19 _fixes_major = 3;
20 _fixes_minor = 0;
21
22 LOGFN(__FILE__, __LINE__, __FUNCTION__);
23 if (XFixesQueryVersion(_ecore_x_disp, &_fixes_major, &_fixes_minor))
24 {
25 _fixes_available = 1;
26
27 ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
28 }
29 else
30 _fixes_available = 0;
31
32#else /* ifdef ECORE_XFIXES */
33 _fixes_available = 0;
34#endif /* ifdef ECORE_XFIXES */
35}
36
37#ifdef ECORE_XFIXES
38/* I don't know what to call this function. */
39static XRectangle *
40_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
41 int num)
42{
43 XRectangle *xrect;
44 int i;
45
46 if (num == 0)
47 return NULL;
48
49 xrect = malloc(sizeof(XRectangle) * num);
50 if (!xrect)
51 return NULL;
52
53 for (i = 0; i < num; i++)
54 {
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;
59 }
60 return xrect;
61}
62
63static Ecore_X_Rectangle *
64_ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
65 int num)
66{
67 Ecore_X_Rectangle *rects;
68 int i;
69
70 if (num == 0)
71 return NULL;
72
73 rects = malloc(sizeof(Ecore_X_Rectangle) * num);
74 if (!rects)
75 return NULL;
76
77 for (i = 0; i < num; i++)
78 {
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;
83 }
84 return rects;
85}
86
87#endif /* ifdef ECORE_XFIXES */
88
89EAPI Eina_Bool
90ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
91{
92#ifdef ECORE_XFIXES
93 if (_fixes_available)
94 {
95 XFixesSelectSelectionInput (_ecore_x_disp,
96 DefaultRootWindow(_ecore_x_disp),
97 selection,
98 XFixesSetSelectionOwnerNotifyMask |
99 XFixesSelectionWindowDestroyNotifyMask |
100 XFixesSelectionClientCloseNotifyMask);
101 return EINA_TRUE;
102 }
103#endif
104 return EINA_FALSE;
105}
106
107EAPI Ecore_X_Region
108ecore_x_region_new(Ecore_X_Rectangle *rects,
109 int num)
110{
111#ifdef ECORE_XFIXES
112 Ecore_X_Region region;
113 XRectangle *xrect;
114
115 LOGFN(__FILE__, __LINE__, __FUNCTION__);
116 xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
117 region = XFixesCreateRegion(_ecore_x_disp, xrect, num);
118 free(xrect);
119 return region;
120#else /* ifdef ECORE_XFIXES */
121 return 0;
122#endif /* ifdef ECORE_XFIXES */
123}
124
125EAPI Ecore_X_Region
126ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
127{
128#ifdef ECORE_XFIXES
129 Ecore_X_Region region;
130
131 LOGFN(__FILE__, __LINE__, __FUNCTION__);
132 region = XFixesCreateRegionFromBitmap(_ecore_x_disp, bitmap);
133 return region;
134#else /* ifdef ECORE_XFIXES */
135 return 0;
136#endif /* ifdef ECORE_XFIXES */
137}
138
139EAPI Ecore_X_Region
140ecore_x_region_new_from_window(Ecore_X_Window win,
141 Ecore_X_Region_Type type)
142{
143#ifdef ECORE_XFIXES
144 Ecore_X_Region region;
145
146 LOGFN(__FILE__, __LINE__, __FUNCTION__);
147 region = XFixesCreateRegionFromWindow(_ecore_x_disp, win, type);
148 return region;
149#else /* ifdef ECORE_XFIXES */
150 return 0;
151#endif /* ifdef ECORE_XFIXES */
152}
153
154EAPI Ecore_X_Region
155ecore_x_region_new_from_gc(Ecore_X_GC gc)
156{
157#ifdef ECORE_XFIXES
158 Ecore_X_Region region;
159
160 LOGFN(__FILE__, __LINE__, __FUNCTION__);
161 region = XFixesCreateRegionFromGC(_ecore_x_disp, gc);
162 return region;
163#else /* ifdef ECORE_XFIXES */
164 return 0;
165#endif /* ifdef ECORE_XFIXES */
166}
167
168EAPI Ecore_X_Region
169ecore_x_region_new_from_picture(Ecore_X_Picture picture)
170{
171#ifdef ECORE_XFIXES
172 Ecore_X_Region region;
173
174 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175 region = XFixesCreateRegionFromPicture(_ecore_x_disp, picture);
176 return region;
177#else /* ifdef ECORE_XFIXES */
178 return 0;
179#endif /* ifdef ECORE_XFIXES */
180}
181
182EAPI void
183ecore_x_region_free(Ecore_X_Region region)
184{
185#ifdef ECORE_XFIXES
186 LOGFN(__FILE__, __LINE__, __FUNCTION__);
187 XFixesDestroyRegion(_ecore_x_disp, region);
188#endif /* ifdef ECORE_XFIXES */
189}
190
191EAPI void
192ecore_x_region_set(Ecore_X_Region region,
193 Ecore_X_Rectangle *rects,
194 int num)
195{
196#ifdef ECORE_XFIXES
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 */
201}
202
203EAPI void
204ecore_x_region_copy(Ecore_X_Region dest,
205 Ecore_X_Region source)
206{
207#ifdef ECORE_XFIXES
208 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFixesCopyRegion(_ecore_x_disp, dest, source);
210#endif /* ifdef ECORE_XFIXES */
211}
212
213EAPI void
214ecore_x_region_combine(Ecore_X_Region dest,
215 Ecore_X_Region source1,
216 Ecore_X_Region source2)
217{
218#ifdef ECORE_XFIXES
219 LOGFN(__FILE__, __LINE__, __FUNCTION__);
220 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2);
221#endif /* ifdef ECORE_XFIXES */
222}
223
224EAPI void
225ecore_x_region_intersect(Ecore_X_Region dest,
226 Ecore_X_Region source1,
227 Ecore_X_Region source2)
228{
229#ifdef ECORE_XFIXES
230 LOGFN(__FILE__, __LINE__, __FUNCTION__);
231 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2);
232#endif /* ifdef ECORE_XFIXES */
233}
234
235EAPI void
236ecore_x_region_subtract(Ecore_X_Region dest,
237 Ecore_X_Region source1,
238 Ecore_X_Region source2)
239{
240#ifdef ECORE_XFIXES
241 LOGFN(__FILE__, __LINE__, __FUNCTION__);
242 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2);
243#endif /* ifdef ECORE_XFIXES */
244}
245
246EAPI void
247ecore_x_region_invert(Ecore_X_Region dest,
248 Ecore_X_Rectangle *bounds,
249 Ecore_X_Region source)
250{
251#ifdef ECORE_XFIXES
252 XRectangle *xbound;
253 int num = 0;
254
255 LOGFN(__FILE__, __LINE__, __FUNCTION__);
256 while (bounds + num)
257 num++;
258 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num);
259
260 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source);
261#endif /* ifdef ECORE_XFIXES */
262}
263
264EAPI void
265ecore_x_region_translate(Ecore_X_Region region,
266 int dx,
267 int dy)
268{
269#ifdef ECORE_XFIXES
270 LOGFN(__FILE__, __LINE__, __FUNCTION__);
271 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy);
272#endif /* ifdef ECORE_XFIXES */
273}
274
275EAPI void
276ecore_x_region_extents(Ecore_X_Region dest,
277 Ecore_X_Region source)
278{
279#ifdef ECORE_XFIXES
280 LOGFN(__FILE__, __LINE__, __FUNCTION__);
281 XFixesRegionExtents(_ecore_x_disp, dest, source);
282#endif /* ifdef ECORE_XFIXES */
283}
284
285EAPI Ecore_X_Rectangle *
286ecore_x_region_fetch(Ecore_X_Region region,
287 int *num,
288 Ecore_X_Rectangle *bounds){
289#ifdef ECORE_XFIXES
290 Ecore_X_Rectangle *rects;
291 XRectangle *xrect, xbound;
292
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;
300 return rects;
301#else /* ifdef ECORE_XFIXES */
302 return NULL;
303#endif /* ifdef ECORE_XFIXES */
304}
305
306EAPI void
307ecore_x_region_expand(Ecore_X_Region dest,
308 Ecore_X_Region source,
309 unsigned int left,
310 unsigned int right,
311 unsigned int top,
312 unsigned int bottom)
313{
314#ifdef ECORE_XFIXES
315 LOGFN(__FILE__, __LINE__, __FUNCTION__);
316 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom);
317#endif /* ifdef ECORE_XFIXES */
318}
319
320EAPI void
321ecore_x_region_gc_clip_set(Ecore_X_Region region,
322 Ecore_X_GC gc,
323 int x_origin,
324 int y_origin)
325{
326#ifdef ECORE_XFIXES
327 LOGFN(__FILE__, __LINE__, __FUNCTION__);
328 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region);
329#endif /* ifdef ECORE_XFIXES */
330}
331
332EAPI void
333ecore_x_region_window_shape_set(Ecore_X_Region region,
334 Ecore_X_Window win,
335 Ecore_X_Shape_Type type,
336 int x_offset,
337 int y_offset)
338{
339#ifdef ECORE_XFIXES
340 LOGFN(__FILE__, __LINE__, __FUNCTION__);
341 XFixesSetWindowShapeRegion(_ecore_x_disp,
342 win,
343 type,
344 x_offset,
345 y_offset,
346 region);
347#endif /* ifdef ECORE_XFIXES */
348}
349
350EAPI void
351ecore_x_region_picture_clip_set(Ecore_X_Region region,
352 Ecore_X_Picture picture,
353 int x_origin,
354 int y_origin)
355{
356#ifdef ECORE_XFIXES
357 LOGFN(__FILE__, __LINE__, __FUNCTION__);
358 XFixesSetPictureClipRegion(_ecore_x_disp,
359 picture,
360 x_origin,
361 y_origin,
362 region);
363#endif /* ifdef ECORE_XFIXES */
364}
365