aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c158
1 files changed, 0 insertions, 158 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
deleted file mode 100644
index 81d7eea..0000000
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
+++ /dev/null
@@ -1,158 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */
4
5#include "ecore_x_private.h"
6
7/*
8 * [x] XCreateRegion
9 * [ ] XPolygonRegion
10 * [x] XSetRegion
11 * [x] XDestroyRegion
12 *
13 * [x] XOffsetRegion
14 * [ ] XShrinkRegion
15 *
16 * [ ] XClipBox
17 * [x] XIntersectRegion
18 * [x] XUnionRegion
19 * [x] XUnionRectWithRegion
20 * [x] XSubtractRegion
21 * [ ] XXorRegion
22 *
23 * [x] XEmptyRegion
24 * [x] XEqualRegion
25 *
26 * [x] XPointInRegion
27 * [x] XRectInRegion
28 */
29
30EAPI Ecore_X_XRegion *
31ecore_x_xregion_new()
32{
33 LOGFN(__FILE__, __LINE__, __FUNCTION__);
34 return (Ecore_X_XRegion *)XCreateRegion();
35}
36
37EAPI void
38ecore_x_xregion_free(Ecore_X_XRegion *region)
39{
40 LOGFN(__FILE__, __LINE__, __FUNCTION__);
41 if (!region)
42 return;
43
44 XDestroyRegion((Region)region);
45}
46
47EAPI Eina_Bool
48ecore_x_xregion_set(Ecore_X_XRegion *region,
49 Ecore_X_GC gc)
50{
51 LOGFN(__FILE__, __LINE__, __FUNCTION__);
52 return XSetRegion(_ecore_x_disp, gc, (Region)region) ? EINA_TRUE : EINA_FALSE;
53}
54
55EAPI void
56ecore_x_xregion_translate(Ecore_X_XRegion *region,
57 int x,
58 int y)
59{
60 LOGFN(__FILE__, __LINE__, __FUNCTION__);
61 if (!region)
62 return;
63
64 /* return value not used */
65 XOffsetRegion((Region)region, x, y);
66}
67
68EAPI Eina_Bool
69ecore_x_xregion_intersect(Ecore_X_XRegion *dst,
70 Ecore_X_XRegion *r1,
71 Ecore_X_XRegion *r2)
72{
73 LOGFN(__FILE__, __LINE__, __FUNCTION__);
74 return XIntersectRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE;
75}
76
77EAPI Eina_Bool
78ecore_x_xregion_union(Ecore_X_XRegion *dst,
79 Ecore_X_XRegion *r1,
80 Ecore_X_XRegion *r2)
81{
82 LOGFN(__FILE__, __LINE__, __FUNCTION__);
83 return XUnionRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE;
84}
85
86EAPI Eina_Bool
87ecore_x_xregion_union_rect(Ecore_X_XRegion *dst,
88 Ecore_X_XRegion *src,
89 Ecore_X_Rectangle *rect)
90{
91 XRectangle xr;
92
93 LOGFN(__FILE__, __LINE__, __FUNCTION__);
94 xr.x = rect->x;
95 xr.y = rect->y;
96 xr.width = rect->width;
97 xr.height = rect->height;
98
99 return XUnionRectWithRegion(&xr, (Region)src, (Region)dst) ? EINA_TRUE : EINA_FALSE;
100}
101
102EAPI Eina_Bool
103ecore_x_xregion_subtract(Ecore_X_XRegion *dst,
104 Ecore_X_XRegion *rm,
105 Ecore_X_XRegion *rs)
106{
107 LOGFN(__FILE__, __LINE__, __FUNCTION__);
108 return XSubtractRegion((Region)rm, (Region)rs, (Region)dst) ? EINA_TRUE : EINA_FALSE;
109}
110
111EAPI Eina_Bool
112ecore_x_xregion_is_empty(Ecore_X_XRegion *region)
113{
114 if (!region)
115 return EINA_TRUE;
116
117 LOGFN(__FILE__, __LINE__, __FUNCTION__);
118 return XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE;
119}
120
121EAPI Eina_Bool
122ecore_x_xregion_is_equal(Ecore_X_XRegion *r1,
123 Ecore_X_XRegion *r2)
124{
125 if (!r1 || !r2)
126 return EINA_FALSE;
127
128 LOGFN(__FILE__, __LINE__, __FUNCTION__);
129 return XEqualRegion((Region)r1, (Region)r1) ? EINA_TRUE : EINA_FALSE;
130}
131
132EAPI Eina_Bool
133ecore_x_xregion_point_contain(Ecore_X_XRegion *region,
134 int x,
135 int y)
136{
137 if (!region)
138 return EINA_FALSE;
139
140 LOGFN(__FILE__, __LINE__, __FUNCTION__);
141 return XPointInRegion((Region)region, x, y) ? EINA_TRUE : EINA_FALSE;
142}
143
144EAPI Eina_Bool
145ecore_x_xregion_rect_contain(Ecore_X_XRegion *region,
146 Ecore_X_Rectangle *rect)
147{
148 if (!region || !rect)
149 return EINA_FALSE;
150
151 LOGFN(__FILE__, __LINE__, __FUNCTION__);
152 return XRectInRegion((Region)region,
153 rect->x,
154 rect->y,
155 rect->width,
156 rect->height) ? EINA_TRUE : EINA_FALSE;
157}
158