blob: 28cfa0ad4852a74bffbf3b0a635071bc6ae29776 [file] [log] [blame]
syuri843bf672008-09-19 09:55:50 +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
Adam Tkac7269eae2008-12-03 14:24:01 +000054/* - Faked defines to fool the X11 region code */
syuri843bf672008-09-19 09:55:50 +000055
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#define NeedFunctionPrototypes 1
65
Adam Tkac7269eae2008-12-03 14:24:01 +000066/* - Cribbed from Xlib.h */
syuri843bf672008-09-19 09:55:50 +000067
68typedef struct {
69 short x, y;
70} XPoint;
71
72typedef struct {
73 short x, y;
74 unsigned short width, height;
75} XRectangle;
76
77/*
78 * opaque reference to Region data type
79 */
80typedef struct _XRegion *Region;
81
82/* Return values from XRectInRegion() */
83
84#define RectangleOut 0
85#define RectangleIn 1
86#define RectanglePart 2
87
88#ifdef __cplusplus
89extern "C" {
90#endif
91
92extern int XClipBox(
93#if NeedFunctionPrototypes
94 Region /* r */,
95 XRectangle* /* rect_return */
96#endif
97);
98
99extern Region XCreateRegion(
100#if NeedFunctionPrototypes
101 void
102#endif
103);
104
105extern const char *XDefaultString (void);
106
107extern int XDestroyRegion(
108#if NeedFunctionPrototypes
109 Region /* r */
110#endif
111);
112
113extern int XEmptyRegion(
114#if NeedFunctionPrototypes
115 Region /* r */
116#endif
117);
118
119extern int XEqualRegion(
120#if NeedFunctionPrototypes
121 Region /* r1 */,
122 Region /* r2 */
123#endif
124);
125
126extern int XIntersectRegion(
127#if NeedFunctionPrototypes
128 Region /* sra */,
129 Region /* srb */,
130 Region /* dr_return */
131#endif
132);
133
134extern int XOffsetRegion(
135#if NeedFunctionPrototypes
136 Region /* r */,
137 int /* dx */,
138 int /* dy */
139#endif
140);
141
142extern Bool XPointInRegion(
143#if NeedFunctionPrototypes
144 Region /* r */,
145 int /* x */,
146 int /* y */
147#endif
148);
149
150extern Region XPolygonRegion(
151#if NeedFunctionPrototypes
152 XPoint* /* points */,
153 int /* n */,
154 int /* fill_rule */
155#endif
156);
157
158extern int XRectInRegion(
159#if NeedFunctionPrototypes
160 Region /* r */,
161 int /* x */,
162 int /* y */,
163 unsigned int /* width */,
164 unsigned int /* height */
165#endif
166);
167
168extern int XShrinkRegion(
169#if NeedFunctionPrototypes
170 Region /* r */,
171 int /* dx */,
172 int /* dy */
173#endif
174);
175
176extern int XSubtractRegion(
177#if NeedFunctionPrototypes
178 Region /* sra */,
179 Region /* srb */,
180 Region /* dr_return */
181#endif
182);
183
184extern int XUnionRectWithRegion(
185#if NeedFunctionPrototypes
186 XRectangle* /* rectangle */,
187 Region /* src_region */,
188 Region /* dest_region_return */
189#endif
190);
191
192extern int XUnionRegion(
193#if NeedFunctionPrototypes
194 Region /* sra */,
195 Region /* srb */,
196 Region /* dr_return */
197#endif
198);
199
200extern int XXorRegion(
201#if NeedFunctionPrototypes
202 Region /* sra */,
203 Region /* srb */,
204 Region /* dr_return */
205#endif
206);
207
208#ifdef __cplusplus
209};
210#endif
211
212#endif /* _XUTIL_H_ */