blob: 7fa44d965db9b44e82243a51022191ec6714b282 [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */
2
3/***********************************************************
4
5Copyright 1987, 1998 The Open Group
6
7Permission to use, copy, modify, distribute, and sell this software and its
8documentation for any purpose is hereby granted without fee, provided that
9the above copyright notice appear in all copies and that both that
10copyright notice and this permission notice appear in supporting
11documentation.
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall not be
24used in advertising or otherwise to promote the sale, use or other dealings
25in this Software without prior written authorization from The Open Group.
26
27
28Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
29
30 All Rights Reserved
31
32Permission to use, copy, modify, and distribute this software and its
33documentation for any purpose and without fee is hereby granted,
34provided that the above copyright notice appear in all copies and that
35both that copyright notice and this permission notice appear in
36supporting documentation, and that the name of Digital not be
37used in advertising or publicity pertaining to distribution of the
38software without specific, written prior permission.
39
40DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46SOFTWARE.
47
48******************************************************************/
49/* $XFree86: xc/lib/X11/Xutil.h,v 3.4 2001/12/14 19:54:10 dawes Exp $ */
50
51#ifndef _XREGION_H_
52#define _XREGION_H_
53
54// - Faked defines to fool the X11 region code
55
56#include <stdlib.h>
57#include <string.h>
58
59#define Bool int
60#define Xmalloc malloc
61#define Xfree free
62#define Xrealloc realloc
63
64#ifndef max
65#define max(a,b) (((a) > (b)) ? (a) : (b))
66#endif
67
68#ifndef min
69#define min(a,b) (((a) < (b)) ? (a) : (b))
70#endif
71
72#define NeedFunctionPrototypes 1
73
74// - Cribbed from Xlib.h
75
76typedef struct {
77 short x, y;
78} XPoint;
79
80typedef struct {
81 short x, y;
82 unsigned short width, height;
83} XRectangle;
84
85/*
86 * opaque reference to Region data type
87 */
88typedef struct _XRegion *Region;
89
90/* Return values from XRectInRegion() */
91
92#define RectangleOut 0
93#define RectangleIn 1
94#define RectanglePart 2
95
96#ifdef __cplusplus
97extern "C" {
98#endif
99
100extern int XClipBox(
101#if NeedFunctionPrototypes
102 Region /* r */,
103 XRectangle* /* rect_return */
104#endif
105);
106
107extern Region XCreateRegion(
108#if NeedFunctionPrototypes
109 void
110#endif
111);
112
113extern const char *XDefaultString (void);
114
115extern int XDestroyRegion(
116#if NeedFunctionPrototypes
117 Region /* r */
118#endif
119);
120
121extern int XEmptyRegion(
122#if NeedFunctionPrototypes
123 Region /* r */
124#endif
125);
126
127extern int XEqualRegion(
128#if NeedFunctionPrototypes
129 Region /* r1 */,
130 Region /* r2 */
131#endif
132);
133
134extern int XIntersectRegion(
135#if NeedFunctionPrototypes
136 Region /* sra */,
137 Region /* srb */,
138 Region /* dr_return */
139#endif
140);
141
142extern int XOffsetRegion(
143#if NeedFunctionPrototypes
144 Region /* r */,
145 int /* dx */,
146 int /* dy */
147#endif
148);
149
150extern Bool XPointInRegion(
151#if NeedFunctionPrototypes
152 Region /* r */,
153 int /* x */,
154 int /* y */
155#endif
156);
157
158extern Region XPolygonRegion(
159#if NeedFunctionPrototypes
160 XPoint* /* points */,
161 int /* n */,
162 int /* fill_rule */
163#endif
164);
165
166extern int XRectInRegion(
167#if NeedFunctionPrototypes
168 Region /* r */,
169 int /* x */,
170 int /* y */,
171 unsigned int /* width */,
172 unsigned int /* height */
173#endif
174);
175
176extern int XShrinkRegion(
177#if NeedFunctionPrototypes
178 Region /* r */,
179 int /* dx */,
180 int /* dy */
181#endif
182);
183
184extern int XSubtractRegion(
185#if NeedFunctionPrototypes
186 Region /* sra */,
187 Region /* srb */,
188 Region /* dr_return */
189#endif
190);
191
192extern int XUnionRectWithRegion(
193#if NeedFunctionPrototypes
194 XRectangle* /* rectangle */,
195 Region /* src_region */,
196 Region /* dest_region_return */
197#endif
198);
199
200extern int XUnionRegion(
201#if NeedFunctionPrototypes
202 Region /* sra */,
203 Region /* srb */,
204 Region /* dr_return */
205#endif
206);
207
208extern int XXorRegion(
209#if NeedFunctionPrototypes
210 Region /* sra */,
211 Region /* srb */,
212 Region /* dr_return */
213#endif
214);
215
216#ifdef __cplusplus
217};
218#endif
219
220#endif /* _XUTIL_H_ */