syuri | 843bf67 | 2008-09-19 09:55:50 +0000 | [diff] [blame] | 1 | /* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */ |
| 2 | |
| 3 | /*********************************************************** |
| 4 | |
| 5 | Copyright 1987, 1998 The Open Group |
| 6 | |
| 7 | Permission to use, copy, modify, distribute, and sell this software and its |
| 8 | documentation for any purpose is hereby granted without fee, provided that |
| 9 | the above copyright notice appear in all copies and that both that |
| 10 | copyright notice and this permission notice appear in supporting |
| 11 | documentation. |
| 12 | |
| 13 | The above copyright notice and this permission notice shall be included in |
| 14 | all copies or substantial portions of the Software. |
| 15 | |
| 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 20 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | |
| 23 | Except as contained in this notice, the name of The Open Group shall not be |
| 24 | used in advertising or otherwise to promote the sale, use or other dealings |
| 25 | in this Software without prior written authorization from The Open Group. |
| 26 | |
| 27 | |
| 28 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. |
| 29 | |
| 30 | All Rights Reserved |
| 31 | |
| 32 | Permission to use, copy, modify, and distribute this software and its |
| 33 | documentation for any purpose and without fee is hereby granted, |
| 34 | provided that the above copyright notice appear in all copies and that |
| 35 | both that copyright notice and this permission notice appear in |
| 36 | supporting documentation, and that the name of Digital not be |
| 37 | used in advertising or publicity pertaining to distribution of the |
| 38 | software without specific, written prior permission. |
| 39 | |
| 40 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING |
| 41 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL |
| 42 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR |
| 43 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
| 44 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
| 45 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
| 46 | SOFTWARE. |
| 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 Tkac | 7269eae | 2008-12-03 14:24:01 +0000 | [diff] [blame] | 54 | /* - Faked defines to fool the X11 region code */ |
syuri | 843bf67 | 2008-09-19 09:55:50 +0000 | [diff] [blame] | 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 | #define NeedFunctionPrototypes 1 |
| 65 | |
Adam Tkac | 7269eae | 2008-12-03 14:24:01 +0000 | [diff] [blame] | 66 | /* - Cribbed from Xlib.h */ |
syuri | 843bf67 | 2008-09-19 09:55:50 +0000 | [diff] [blame] | 67 | |
| 68 | typedef struct { |
| 69 | short x, y; |
| 70 | } XPoint; |
| 71 | |
| 72 | typedef struct { |
| 73 | short x, y; |
| 74 | unsigned short width, height; |
| 75 | } XRectangle; |
| 76 | |
| 77 | /* |
| 78 | * opaque reference to Region data type |
| 79 | */ |
| 80 | typedef 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 |
| 89 | extern "C" { |
| 90 | #endif |
| 91 | |
| 92 | extern int XClipBox( |
| 93 | #if NeedFunctionPrototypes |
| 94 | Region /* r */, |
| 95 | XRectangle* /* rect_return */ |
| 96 | #endif |
| 97 | ); |
| 98 | |
| 99 | extern Region XCreateRegion( |
| 100 | #if NeedFunctionPrototypes |
| 101 | void |
| 102 | #endif |
| 103 | ); |
| 104 | |
| 105 | extern const char *XDefaultString (void); |
| 106 | |
| 107 | extern int XDestroyRegion( |
| 108 | #if NeedFunctionPrototypes |
| 109 | Region /* r */ |
| 110 | #endif |
| 111 | ); |
| 112 | |
| 113 | extern int XEmptyRegion( |
| 114 | #if NeedFunctionPrototypes |
| 115 | Region /* r */ |
| 116 | #endif |
| 117 | ); |
| 118 | |
| 119 | extern int XEqualRegion( |
| 120 | #if NeedFunctionPrototypes |
| 121 | Region /* r1 */, |
| 122 | Region /* r2 */ |
| 123 | #endif |
| 124 | ); |
| 125 | |
| 126 | extern int XIntersectRegion( |
| 127 | #if NeedFunctionPrototypes |
| 128 | Region /* sra */, |
| 129 | Region /* srb */, |
| 130 | Region /* dr_return */ |
| 131 | #endif |
| 132 | ); |
| 133 | |
| 134 | extern int XOffsetRegion( |
| 135 | #if NeedFunctionPrototypes |
| 136 | Region /* r */, |
| 137 | int /* dx */, |
| 138 | int /* dy */ |
| 139 | #endif |
| 140 | ); |
| 141 | |
| 142 | extern Bool XPointInRegion( |
| 143 | #if NeedFunctionPrototypes |
| 144 | Region /* r */, |
| 145 | int /* x */, |
| 146 | int /* y */ |
| 147 | #endif |
| 148 | ); |
| 149 | |
| 150 | extern Region XPolygonRegion( |
| 151 | #if NeedFunctionPrototypes |
| 152 | XPoint* /* points */, |
| 153 | int /* n */, |
| 154 | int /* fill_rule */ |
| 155 | #endif |
| 156 | ); |
| 157 | |
| 158 | extern 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 | |
| 168 | extern int XShrinkRegion( |
| 169 | #if NeedFunctionPrototypes |
| 170 | Region /* r */, |
| 171 | int /* dx */, |
| 172 | int /* dy */ |
| 173 | #endif |
| 174 | ); |
| 175 | |
| 176 | extern int XSubtractRegion( |
| 177 | #if NeedFunctionPrototypes |
| 178 | Region /* sra */, |
| 179 | Region /* srb */, |
| 180 | Region /* dr_return */ |
| 181 | #endif |
| 182 | ); |
| 183 | |
| 184 | extern int XUnionRectWithRegion( |
| 185 | #if NeedFunctionPrototypes |
| 186 | XRectangle* /* rectangle */, |
| 187 | Region /* src_region */, |
| 188 | Region /* dest_region_return */ |
| 189 | #endif |
| 190 | ); |
| 191 | |
| 192 | extern int XUnionRegion( |
| 193 | #if NeedFunctionPrototypes |
| 194 | Region /* sra */, |
| 195 | Region /* srb */, |
| 196 | Region /* dr_return */ |
| 197 | #endif |
| 198 | ); |
| 199 | |
| 200 | extern 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_ */ |