Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 1 | |
| 2 | /*********************************************************** |
| 3 | |
| 4 | Copyright 1987, 1998 The Open Group |
| 5 | |
| 6 | Permission to use, copy, modify, distribute, and sell this software and its |
| 7 | documentation for any purpose is hereby granted without fee, provided that |
| 8 | the above copyright notice appear in all copies and that both that |
| 9 | copyright notice and this permission notice appear in supporting |
| 10 | documentation. |
| 11 | |
| 12 | The above copyright notice and this permission notice shall be included in |
| 13 | all copies or substantial portions of the Software. |
| 14 | |
| 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 19 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | |
| 22 | Except as contained in this notice, the name of The Open Group shall not be |
| 23 | used in advertising or otherwise to promote the sale, use or other dealings |
| 24 | in this Software without prior written authorization from The Open Group. |
| 25 | |
| 26 | |
| 27 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. |
| 28 | |
| 29 | All Rights Reserved |
| 30 | |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 31 | Permission to use, copy, modify, and distribute this software and its |
| 32 | documentation for any purpose and without fee is hereby granted, |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 33 | provided that the above copyright notice appear in all copies and that |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 34 | both that copyright notice and this permission notice appear in |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 35 | supporting documentation, and that the name of Digital not be |
| 36 | used in advertising or publicity pertaining to distribution of the |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 37 | software without specific, written prior permission. |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 38 | |
| 39 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING |
| 40 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL |
| 41 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR |
| 42 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
| 43 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
| 44 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
| 45 | SOFTWARE. |
| 46 | |
| 47 | ******************************************************************/ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 48 | |
| 49 | #ifndef _X11_XUTIL_H_ |
| 50 | #define _X11_XUTIL_H_ |
| 51 | |
| 52 | /* You must include <X11/Xlib.h> before including this file */ |
| 53 | #include "Xlib.h" |
| 54 | |
Pierre Ossman | b7afc38 | 2016-05-13 16:11:34 +0200 | [diff] [blame^] | 55 | /****** Avoid symbol clash with "real" libX11 ******/ |
| 56 | #define XClipBox vncXClipBox |
| 57 | #define XCreateRegion vncXCreateRegion |
| 58 | #define XDestroyRegion vncXDestroyRegion |
| 59 | #define XEmptyRegion vncXEmptyRegion |
| 60 | #define XEqualRegion vncXEqualRegion |
| 61 | #define XIntersectRegion vncXIntersectRegion |
| 62 | #define XOffsetRegion vncXOffsetRegion |
| 63 | #define XPointInRegion vncXPointInRegion |
| 64 | #define XPolygonRegion vncXPolygonRegion |
| 65 | #define XRectInRegion vncXRectInRegion |
| 66 | #define XShrinkRegion vncXShrinkRegion |
| 67 | #define XSubtractRegion vncXSubtractRegion |
| 68 | #define XUnionRectWithRegion vncXUnionRectWithRegion |
| 69 | #define XUnionRegion vncXUnionRegion |
| 70 | #define XXorRegion vncXXorRegion |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 71 | |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 72 | /* |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 73 | * opaque reference to Region data type |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 74 | */ |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 75 | typedef struct _XRegion *Region; |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 76 | |
| 77 | /* Return values from XRectInRegion() */ |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 78 | |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 79 | #define RectangleOut 0 |
| 80 | #define RectangleIn 1 |
| 81 | #define RectanglePart 2 |
| 82 | |
| 83 | extern int XClipBox( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 84 | Region /* r */, |
| 85 | XRectangle* /* rect_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 86 | ); |
| 87 | |
| 88 | extern Region XCreateRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 89 | void |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 90 | ); |
| 91 | |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 92 | extern int XDestroyRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 93 | Region /* r */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 94 | ); |
| 95 | |
| 96 | extern int XEmptyRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 97 | Region /* r */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 98 | ); |
| 99 | |
| 100 | extern int XEqualRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 101 | Region /* r1 */, |
| 102 | Region /* r2 */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 103 | ); |
| 104 | |
| 105 | extern int XIntersectRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 106 | Region /* sra */, |
| 107 | Region /* srb */, |
| 108 | Region /* dr_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 109 | ); |
| 110 | |
| 111 | extern int XOffsetRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 112 | Region /* r */, |
| 113 | int /* dx */, |
| 114 | int /* dy */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 115 | ); |
| 116 | |
| 117 | extern Bool XPointInRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 118 | Region /* r */, |
| 119 | int /* x */, |
| 120 | int /* y */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 121 | ); |
| 122 | |
| 123 | extern Region XPolygonRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 124 | XPoint* /* points */, |
| 125 | int /* n */, |
| 126 | int /* fill_rule */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 127 | ); |
| 128 | |
| 129 | extern int XRectInRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 130 | Region /* r */, |
| 131 | int /* x */, |
| 132 | int /* y */, |
| 133 | unsigned int /* width */, |
| 134 | unsigned int /* height */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 135 | ); |
| 136 | |
| 137 | extern int XShrinkRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 138 | Region /* r */, |
| 139 | int /* dx */, |
| 140 | int /* dy */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 141 | ); |
| 142 | |
| 143 | extern int XSubtractRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 144 | Region /* sra */, |
| 145 | Region /* srb */, |
| 146 | Region /* dr_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 147 | ); |
| 148 | |
| 149 | extern int XUnionRectWithRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 150 | XRectangle* /* rectangle */, |
| 151 | Region /* src_region */, |
| 152 | Region /* dest_region_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 153 | ); |
| 154 | |
| 155 | extern int XUnionRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 156 | Region /* sra */, |
| 157 | Region /* srb */, |
| 158 | Region /* dr_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 159 | ); |
| 160 | |
| 161 | extern int XXorRegion( |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 162 | Region /* sra */, |
| 163 | Region /* srb */, |
| 164 | Region /* dr_return */ |
Pierre Ossman | 88903f2 | 2016-05-13 15:53:25 +0200 | [diff] [blame] | 165 | ); |
| 166 | |
Pierre Ossman | 3157ed9 | 2016-05-13 16:00:10 +0200 | [diff] [blame] | 167 | #endif /* _X11_XUTIL_H_ */ |