]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/gcstruct.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / programs / Xserver / include / gcstruct.h
1 /* $XConsortium: gcstruct.h,v 5.10 94/04/17 20:25:45 dpw Exp $ */
2 /***********************************************************
3
4 Copyright (c) 1987  X Consortium
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
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 X CONSORTIUM 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 X Consortium 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 X Consortium.
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
50 #ifndef GCSTRUCT_H
51 #define GCSTRUCT_H
52
53 #include "gc.h"
54
55 #include "miscstruct.h"
56 #include "region.h"
57 #include "pixmap.h"
58 #include "screenint.h"
59 #include "Xprotostr.h"
60
61 /*
62  * functions which modify the state of the GC
63  */
64
65 typedef struct _GCFuncs {
66     void        (* ValidateGC)(
67 #if NeedNestedPrototypes
68                 GCPtr /*pGC*/,
69                 unsigned long /*stateChanges*/,
70                 DrawablePtr /*pDrawable*/
71 #endif
72 );
73
74     void        (* ChangeGC)(
75 #if NeedNestedPrototypes
76                 GCPtr /*pGC*/,
77                 unsigned long /*mask*/
78 #endif
79 );
80
81     void        (* CopyGC)(
82 #if NeedNestedPrototypes
83                 GCPtr /*pGCSrc*/,
84                 unsigned long /*mask*/,
85                 GCPtr /*pGCDst*/
86 #endif
87 );
88
89     void        (* DestroyGC)(
90 #if NeedNestedPrototypes
91                 GCPtr /*pGC*/
92 #endif
93 );
94
95     void        (* ChangeClip)(
96 #if NeedNestedPrototypes
97                 GCPtr /*pGC*/,
98                 int /*type*/,
99                 pointer /*pvalue*/,
100                 int /*nrects*/
101 #endif
102 );
103
104     void        (* DestroyClip)(
105 #if NeedNestedPrototypes
106                 GCPtr /*pGC*/
107 #endif
108 );
109
110     void        (* CopyClip)(
111 #if NeedNestedPrototypes
112                 GCPtr /*pgcDst*/,
113                 GCPtr /*pgcSrc*/
114 #endif
115 );
116     DevUnion    devPrivate;
117 } GCFuncs;
118
119 /*
120  * graphics operations invoked through a GC
121  */
122
123 typedef struct _GCOps {
124     void        (* FillSpans)(
125 #if NeedNestedPrototypes
126                 DrawablePtr /*pDrawable*/,
127                 GCPtr /*pGC*/,
128                 int /*nInit*/,
129                 DDXPointPtr /*pptInit*/,
130                 int * /*pwidthInit*/,
131                 int /*fSorted*/
132 #endif
133 );
134
135     void        (* SetSpans)(
136 #if NeedNestedPrototypes
137                 DrawablePtr /*pDrawable*/,
138                 GCPtr /*pGC*/,
139                 char * /*psrc*/,
140                 DDXPointPtr /*ppt*/,
141                 int * /*pwidth*/,
142                 int /*nspans*/,
143                 int /*fSorted*/
144 #endif
145 );
146
147     void        (* PutImage)(
148 #if NeedNestedPrototypes
149                 DrawablePtr /*pDrawable*/,
150                 GCPtr /*pGC*/,
151                 int /*depth*/,
152                 int /*x*/,
153                 int /*y*/,
154                 int /*w*/,
155                 int /*h*/,
156                 int /*leftPad*/,
157                 int /*format*/,
158                 char * /*pBits*/
159 #endif
160 );
161
162     RegionPtr   (* CopyArea)(
163 #if NeedNestedPrototypes
164                 DrawablePtr /*pSrc*/,
165                 DrawablePtr /*pDst*/,
166                 GCPtr /*pGC*/,
167                 int /*srcx*/,
168                 int /*srcy*/,
169                 int /*w*/,
170                 int /*h*/,
171                 int /*dstx*/,
172                 int /*dsty*/
173 #endif
174 );
175
176     RegionPtr   (* CopyPlane)(
177 #if NeedNestedPrototypes
178                 DrawablePtr /*pSrcDrawable*/,
179                 DrawablePtr /*pDstDrawable*/,
180                 GCPtr /*pGC*/,
181                 int /*srcx*/,
182                 int /*srcy*/,
183                 int /*width*/,
184                 int /*height*/,
185                 int /*dstx*/,
186                 int /*dsty*/,
187                 unsigned long /*bitPlane*/
188 #endif
189 );
190     void        (* PolyPoint)(
191 #if NeedNestedPrototypes
192                 DrawablePtr /*pDrawable*/,
193                 GCPtr /*pGC*/,
194                 int /*mode*/,
195                 int /*npt*/,
196                 DDXPointPtr /*pptInit*/
197 #endif
198 );
199
200     void        (* Polylines)(
201 #if NeedNestedPrototypes
202                 DrawablePtr /*pDrawable*/,
203                 GCPtr /*pGC*/,
204                 int /*mode*/,
205                 int /*npt*/,
206                 DDXPointPtr /*pptInit*/
207 #endif
208 );
209
210     void        (* PolySegment)(
211 #if NeedNestedPrototypes
212                 DrawablePtr /*pDrawable*/,
213                 GCPtr /*pGC*/,
214                 int /*nseg*/,
215                 xSegment * /*pSegs*/
216 #endif
217 );
218
219     void        (* PolyRectangle)(
220 #if NeedNestedPrototypes
221                 DrawablePtr /*pDrawable*/,
222                 GCPtr /*pGC*/,
223                 int /*nrects*/,
224                 xRectangle * /*pRects*/
225 #endif
226 );
227
228     void        (* PolyArc)(
229 #if NeedNestedPrototypes
230                 DrawablePtr /*pDrawable*/,
231                 GCPtr /*pGC*/,
232                 int /*narcs*/,
233                 xArc * /*parcs*/
234 #endif
235 );
236
237     void        (* FillPolygon)(
238 #if NeedNestedPrototypes
239                 DrawablePtr /*pDrawable*/,
240                 GCPtr /*pGC*/,
241                 int /*shape*/,
242                 int /*mode*/,
243                 int /*count*/,
244                 DDXPointPtr /*pPts*/
245 #endif
246 );
247
248     void        (* PolyFillRect)(
249 #if NeedNestedPrototypes
250                 DrawablePtr /*pDrawable*/,
251                 GCPtr /*pGC*/,
252                 int /*nrectFill*/,
253                 xRectangle * /*prectInit*/
254 #endif
255 );
256
257     void        (* PolyFillArc)(
258 #if NeedNestedPrototypes
259                 DrawablePtr /*pDrawable*/,
260                 GCPtr /*pGC*/,
261                 int /*narcs*/,
262                 xArc * /*parcs*/
263 #endif
264 );
265
266     int         (* PolyText8)(
267 #if NeedNestedPrototypes
268                 DrawablePtr /*pDrawable*/,
269                 GCPtr /*pGC*/,
270                 int /*x*/,
271                 int /*y*/,
272                 int /*count*/,
273                 char * /*chars*/
274 #endif
275 );
276
277     int         (* PolyText16)(
278 #if NeedNestedPrototypes
279                 DrawablePtr /*pDrawable*/,
280                 GCPtr /*pGC*/,
281                 int /*x*/,
282                 int /*y*/,
283                 int /*count*/,
284                 unsigned short * /*chars*/
285 #endif
286 );
287
288     void        (* ImageText8)(
289 #if NeedNestedPrototypes
290                 DrawablePtr /*pDrawable*/,
291                 GCPtr /*pGC*/,
292                 int /*x*/,
293                 int /*y*/,
294                 int /*count*/,
295                 char * /*chars*/
296 #endif
297 );
298
299     void        (* ImageText16)(
300 #if NeedNestedPrototypes
301                 DrawablePtr /*pDrawable*/,
302                 GCPtr /*pGC*/,
303                 int /*x*/,
304                 int /*y*/,
305                 int /*count*/,
306                 unsigned short * /*chars*/
307 #endif
308 );
309
310     void        (* ImageGlyphBlt)(
311 #if NeedNestedPrototypes
312                 DrawablePtr /*pDrawable*/,
313                 GCPtr /*pGC*/,
314                 int /*x*/,
315                 int /*y*/,
316                 unsigned int /*nglyph*/,
317                 CharInfoPtr * /*ppci*/,
318                 pointer /*pglyphBase*/
319 #endif
320 );
321
322     void        (* PolyGlyphBlt)(
323 #if NeedNestedPrototypes
324                 DrawablePtr /*pDrawable*/,
325                 GCPtr /*pGC*/,
326                 int /*x*/,
327                 int /*y*/,
328                 unsigned int /*nglyph*/,
329                 CharInfoPtr * /*ppci*/,
330                 pointer /*pglyphBase*/
331 #endif
332 );
333
334     void        (* PushPixels)(
335 #if NeedNestedPrototypes
336                 GCPtr /*pGC*/,
337                 PixmapPtr /*pBitMap*/,
338                 DrawablePtr /*pDst*/,
339                 int /*w*/,
340                 int /*h*/,
341                 int /*x*/,
342                 int /*y*/
343 #endif
344 );
345
346 #ifdef NEED_LINEHELPER
347     void        (* LineHelper)();
348 #endif
349
350     DevUnion    devPrivate;
351 } GCOps;
352
353 /* there is padding in the bit fields because the Sun compiler doesn't
354  * force alignment to 32-bit boundaries.  losers.
355  */
356 typedef struct _GC {
357     ScreenPtr           pScreen;                
358     unsigned char       depth;    
359     unsigned char       alu;
360     unsigned short      lineWidth;          
361     unsigned short      dashOffset;
362     unsigned short      numInDashList;
363     unsigned char       *dash;
364     unsigned int        lineStyle : 2;
365     unsigned int        capStyle : 2;
366     unsigned int        joinStyle : 2;
367     unsigned int        fillStyle : 2;
368     unsigned int        fillRule : 1;
369     unsigned int        arcMode : 1;
370     unsigned int        subWindowMode : 1;
371     unsigned int        graphicsExposures : 1;
372     unsigned int        clientClipType : 2; /* CT_<kind> */
373     unsigned int        miTranslate:1; /* should mi things translate? */
374     unsigned int        tileIsPixel:1; /* tile is solid pixel */
375     unsigned int        unused:16; /* see comment above */
376     unsigned long       planemask;
377     unsigned long       fgPixel;
378     unsigned long       bgPixel;
379     /*
380      * alas -- both tile and stipple must be here as they
381      * are independently specifiable
382      */
383     PixUnion            tile;
384     PixmapPtr           stipple;
385     DDXPointRec         patOrg;         /* origin for (tile, stipple) */
386     struct _Font        *font;
387     DDXPointRec         clipOrg;
388     DDXPointRec         lastWinOrg;     /* position of window last validated */
389     pointer             clientClip;
390     unsigned long       stateChanges;   /* masked with GC_<kind> */
391     unsigned long       serialNumber;
392     GCFuncs             *funcs;
393     GCOps               *ops;
394     DevUnion            *devPrivates;
395 } GC;
396
397 #endif /* GCSTRUCT_H */