1 | /* $XFree86: xc/programs/Xserver/include/gc.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */
|
---|
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 |
|
---|
31 | Permission to use, copy, modify, and distribute this software and its
|
---|
32 | documentation for any purpose and without fee is hereby granted,
|
---|
33 | provided that the above copyright notice appear in all copies and that
|
---|
34 | both that copyright notice and this permission notice appear in
|
---|
35 | supporting documentation, and that the name of Digital not be
|
---|
36 | used in advertising or publicity pertaining to distribution of the
|
---|
37 | software without specific, written prior permission.
|
---|
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 | ******************************************************************/
|
---|
48 | /* $Xorg: gc.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
|
---|
49 |
|
---|
50 | #ifndef GC_H
|
---|
51 | #define GC_H
|
---|
52 |
|
---|
53 | #include "X11/X.h" /* for GContext, Mask */
|
---|
54 | #include "Xdefs.h" /* for Bool */
|
---|
55 | #include "X11/Xproto.h"
|
---|
56 | #include "screenint.h" /* for ScreenPtr */
|
---|
57 | #include "pixmap.h" /* for DrawablePtr */
|
---|
58 |
|
---|
59 | /* clientClipType field in GC */
|
---|
60 | #define CT_NONE 0
|
---|
61 | #define CT_PIXMAP 1
|
---|
62 | #define CT_REGION 2
|
---|
63 | #define CT_UNSORTED 6
|
---|
64 | #define CT_YSORTED 10
|
---|
65 | #define CT_YXSORTED 14
|
---|
66 | #define CT_YXBANDED 18
|
---|
67 |
|
---|
68 | #define GCQREASON_VALIDATE 1
|
---|
69 | #define GCQREASON_CHANGE 2
|
---|
70 | #define GCQREASON_COPY_SRC 3
|
---|
71 | #define GCQREASON_COPY_DST 4
|
---|
72 | #define GCQREASON_DESTROY 5
|
---|
73 |
|
---|
74 | #define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
|
---|
75 | #define GC_CALL_VALIDATE_BIT (1L<<30)
|
---|
76 | #define GCExtensionInterest (1L<<29)
|
---|
77 |
|
---|
78 | #define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
|
---|
79 |
|
---|
80 | #define MAX_SERIAL_NUM (1L<<28)
|
---|
81 |
|
---|
82 | #define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
|
---|
83 | (globalSerialNumber = 1): globalSerialNumber)
|
---|
84 |
|
---|
85 | typedef struct _GCInterest *GCInterestPtr;
|
---|
86 | typedef struct _GC *GCPtr;
|
---|
87 | typedef struct _GCOps *GCOpsPtr;
|
---|
88 |
|
---|
89 | extern void ValidateGC(
|
---|
90 | #if NeedFunctionPrototypes
|
---|
91 | DrawablePtr /*pDraw*/,
|
---|
92 | GCPtr /*pGC*/
|
---|
93 | #endif
|
---|
94 | );
|
---|
95 |
|
---|
96 | extern int ChangeGC(
|
---|
97 | #if NeedFunctionPrototypes
|
---|
98 | GCPtr/*pGC*/,
|
---|
99 | BITS32 /*mask*/,
|
---|
100 | XID* /*pval*/
|
---|
101 | #endif
|
---|
102 | );
|
---|
103 |
|
---|
104 | extern int DoChangeGC(
|
---|
105 | #if NeedFunctionPrototypes
|
---|
106 | GCPtr/*pGC*/,
|
---|
107 | BITS32 /*mask*/,
|
---|
108 | XID* /*pval*/,
|
---|
109 | int /*fPointer*/
|
---|
110 | #endif
|
---|
111 | );
|
---|
112 |
|
---|
113 | typedef union {
|
---|
114 | CARD32 val;
|
---|
115 | pointer ptr;
|
---|
116 | } ChangeGCVal, *ChangeGCValPtr;
|
---|
117 |
|
---|
118 | extern int dixChangeGC(
|
---|
119 | #if NeedFunctionPrototypes
|
---|
120 | ClientPtr /*client*/,
|
---|
121 | GCPtr /*pGC*/,
|
---|
122 | BITS32 /*mask*/,
|
---|
123 | CARD32 * /*pval*/,
|
---|
124 | ChangeGCValPtr /*pCGCV*/
|
---|
125 | #endif
|
---|
126 | );
|
---|
127 |
|
---|
128 | extern GCPtr CreateGC(
|
---|
129 | #if NeedFunctionPrototypes
|
---|
130 | DrawablePtr /*pDrawable*/,
|
---|
131 | BITS32 /*mask*/,
|
---|
132 | XID* /*pval*/,
|
---|
133 | int* /*pStatus*/
|
---|
134 | #endif
|
---|
135 | );
|
---|
136 |
|
---|
137 | extern int CopyGC(
|
---|
138 | #if NeedFunctionPrototypes
|
---|
139 | GCPtr/*pgcSrc*/,
|
---|
140 | GCPtr/*pgcDst*/,
|
---|
141 | BITS32 /*mask*/
|
---|
142 | #endif
|
---|
143 | );
|
---|
144 |
|
---|
145 | extern int FreeGC(
|
---|
146 | #if NeedFunctionPrototypes
|
---|
147 | pointer /*pGC*/,
|
---|
148 | XID /*gid*/
|
---|
149 | #endif
|
---|
150 | );
|
---|
151 |
|
---|
152 | extern void SetGCMask(
|
---|
153 | #if NeedFunctionPrototypes
|
---|
154 | GCPtr /*pGC*/,
|
---|
155 | Mask /*selectMask*/,
|
---|
156 | Mask /*newDataMask*/
|
---|
157 | #endif
|
---|
158 | );
|
---|
159 |
|
---|
160 | extern GCPtr CreateScratchGC(
|
---|
161 | #if NeedFunctionPrototypes
|
---|
162 | ScreenPtr /*pScreen*/,
|
---|
163 | unsigned /*depth*/
|
---|
164 | #endif
|
---|
165 | );
|
---|
166 |
|
---|
167 | extern void FreeGCperDepth(
|
---|
168 | #if NeedFunctionPrototypes
|
---|
169 | int /*screenNum*/
|
---|
170 | #endif
|
---|
171 | );
|
---|
172 |
|
---|
173 | extern Bool CreateGCperDepth(
|
---|
174 | #if NeedFunctionPrototypes
|
---|
175 | int /*screenNum*/
|
---|
176 | #endif
|
---|
177 | );
|
---|
178 |
|
---|
179 | extern Bool CreateDefaultStipple(
|
---|
180 | #if NeedFunctionPrototypes
|
---|
181 | int /*screenNum*/
|
---|
182 | #endif
|
---|
183 | );
|
---|
184 |
|
---|
185 | extern void FreeDefaultStipple(
|
---|
186 | #if NeedFunctionPrototypes
|
---|
187 | int /*screenNum*/
|
---|
188 | #endif
|
---|
189 | );
|
---|
190 |
|
---|
191 | extern int SetDashes(
|
---|
192 | #if NeedFunctionPrototypes
|
---|
193 | GCPtr /*pGC*/,
|
---|
194 | unsigned /*offset*/,
|
---|
195 | unsigned /*ndash*/,
|
---|
196 | unsigned char* /*pdash*/
|
---|
197 | #endif
|
---|
198 | );
|
---|
199 |
|
---|
200 | extern int VerifyRectOrder(
|
---|
201 | #if NeedFunctionPrototypes
|
---|
202 | int /*nrects*/,
|
---|
203 | xRectangle* /*prects*/,
|
---|
204 | int /*ordering*/
|
---|
205 | #endif
|
---|
206 | );
|
---|
207 |
|
---|
208 | extern int SetClipRects(
|
---|
209 | #if NeedFunctionPrototypes
|
---|
210 | GCPtr /*pGC*/,
|
---|
211 | int /*xOrigin*/,
|
---|
212 | int /*yOrigin*/,
|
---|
213 | int /*nrects*/,
|
---|
214 | xRectangle* /*prects*/,
|
---|
215 | int /*ordering*/
|
---|
216 | #endif
|
---|
217 | );
|
---|
218 |
|
---|
219 | extern GCPtr GetScratchGC(
|
---|
220 | #if NeedFunctionPrototypes
|
---|
221 | unsigned /*depth*/,
|
---|
222 | ScreenPtr /*pScreen*/
|
---|
223 | #endif
|
---|
224 | );
|
---|
225 |
|
---|
226 | extern void FreeScratchGC(
|
---|
227 | #if NeedFunctionPrototypes
|
---|
228 | GCPtr /*pGC*/
|
---|
229 | #endif
|
---|
230 | );
|
---|
231 |
|
---|
232 | #endif /* GC_H */
|
---|