gcstruct.h revision 05b261ec
11.4Spooka/***********************************************************
21.1Spooka
31.1SpookaCopyright 1987, 1998  The Open Group
41.1Spooka
51.1SpookaPermission to use, copy, modify, distribute, and sell this software and its
61.1Spookadocumentation for any purpose is hereby granted without fee, provided that
71.1Spookathe above copyright notice appear in all copies and that both that
81.1Spookacopyright notice and this permission notice appear in supporting
91.1Spookadocumentation.
101.1Spooka
111.1SpookaThe above copyright notice and this permission notice shall be included in
121.1Spookaall copies or substantial portions of the Software.
131.1Spooka
141.1SpookaTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
151.1SpookaIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161.1SpookaFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
171.1SpookaOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
181.1SpookaAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
191.1SpookaCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
201.1Spooka
211.1SpookaExcept as contained in this notice, the name of The Open Group shall not be
221.1Spookaused in advertising or otherwise to promote the sale, use or other dealings
231.1Spookain this Software without prior written authorization from The Open Group.
241.1Spooka
251.1Spooka
261.1SpookaCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
271.1Spooka
281.1Spooka                        All Rights Reserved
291.1Spooka
301.1SpookaPermission to use, copy, modify, and distribute this software and its
311.1Spookadocumentation for any purpose and without fee is hereby granted,
321.1Spookaprovided that the above copyright notice appear in all copies and that
331.1Spookaboth that copyright notice and this permission notice appear in
341.1Spookasupporting documentation, and that the name of Digital not be
351.4Spookaused in advertising or publicity pertaining to distribution of the
361.1Spookasoftware without specific, written prior permission.
371.1Spooka
381.1SpookaDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
391.1SpookaALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
401.1SpookaDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
411.1SpookaANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
421.1SpookaWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
431.1SpookaARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
441.1SpookaSOFTWARE.
451.1Spooka
461.1Spooka******************************************************************/
471.1Spooka
481.1Spooka
491.1Spooka
501.1Spooka#ifndef GCSTRUCT_H
511.1Spooka#define GCSTRUCT_H
521.1Spooka
531.1Spooka#include "gc.h"
541.1Spooka
551.1Spooka#include "regionstr.h"
561.1Spooka#include "region.h"
571.1Spooka#include "pixmap.h"
581.1Spooka#include "screenint.h"
591.1Spooka#include <X11/Xprotostr.h>
601.1Spooka
611.1Spooka/*
621.1Spooka * functions which modify the state of the GC
631.1Spooka */
641.1Spooka
651.1Spookatypedef struct _GCFuncs {
661.1Spooka    void	(* ValidateGC)(
671.1Spooka		GCPtr /*pGC*/,
681.1Spooka		unsigned long /*stateChanges*/,
691.1Spooka		DrawablePtr /*pDrawable*/);
701.1Spooka
711.1Spooka    void	(* ChangeGC)(
721.1Spooka		GCPtr /*pGC*/,
731.1Spooka		unsigned long /*mask*/);
741.1Spooka
751.1Spooka    void	(* CopyGC)(
761.1Spooka		GCPtr /*pGCSrc*/,
771.2Schristos		unsigned long /*mask*/,
781.1Spooka		GCPtr /*pGCDst*/);
791.1Spooka
801.1Spooka    void	(* DestroyGC)(
811.1Spooka		GCPtr /*pGC*/);
821.1Spooka
831.2Schristos    void	(* ChangeClip)(
841.3Schristos		GCPtr /*pGC*/,
851.1Spooka		int /*type*/,
861.1Spooka		pointer /*pvalue*/,
871.1Spooka		int /*nrects*/);
881.1Spooka
891.1Spooka    void	(* DestroyClip)(
901.1Spooka		GCPtr /*pGC*/);
911.1Spooka
921.1Spooka    void	(* CopyClip)(
931.1Spooka		GCPtr /*pgcDst*/,
941.1Spooka		GCPtr /*pgcSrc*/);
951.1Spooka    DevUnion	devPrivate;
961.1Spooka} GCFuncs;
971.1Spooka
981.1Spooka/*
991.1Spooka * graphics operations invoked through a GC
1001.1Spooka */
1011.1Spooka
1021.1Spookatypedef struct _GCOps {
1031.1Spooka    void	(* FillSpans)(
1041.1Spooka		DrawablePtr /*pDrawable*/,
1051.1Spooka		GCPtr /*pGC*/,
1061.1Spooka		int /*nInit*/,
1071.1Spooka		DDXPointPtr /*pptInit*/,
1081.1Spooka		int * /*pwidthInit*/,
1091.1Spooka		int /*fSorted*/);
1101.1Spooka
1111.1Spooka    void	(* SetSpans)(
1121.1Spooka		DrawablePtr /*pDrawable*/,
1131.1Spooka		GCPtr /*pGC*/,
1141.1Spooka		char * /*psrc*/,
1151.1Spooka		DDXPointPtr /*ppt*/,
1161.1Spooka		int * /*pwidth*/,
1171.1Spooka		int /*nspans*/,
1181.1Spooka		int /*fSorted*/);
1191.1Spooka
1201.1Spooka    void	(* PutImage)(
1211.1Spooka		DrawablePtr /*pDrawable*/,
1221.1Spooka		GCPtr /*pGC*/,
1231.1Spooka		int /*depth*/,
1241.1Spooka		int /*x*/,
1251.1Spooka		int /*y*/,
1261.1Spooka		int /*w*/,
1271.1Spooka		int /*h*/,
1281.1Spooka		int /*leftPad*/,
1291.1Spooka		int /*format*/,
1301.1Spooka		char * /*pBits*/);
1311.1Spooka
1321.1Spooka    RegionPtr	(* CopyArea)(
1331.1Spooka		DrawablePtr /*pSrc*/,
1341.4Spooka		DrawablePtr /*pDst*/,
1351.4Spooka		GCPtr /*pGC*/,
1361.4Spooka		int /*srcx*/,
1371.4Spooka		int /*srcy*/,
1381.4Spooka		int /*w*/,
1391.4Spooka		int /*h*/,
1401.4Spooka		int /*dstx*/,
1411.4Spooka		int /*dsty*/);
1421.4Spooka
1431.4Spooka    RegionPtr	(* CopyPlane)(
1441.4Spooka		DrawablePtr /*pSrcDrawable*/,
1451.4Spooka		DrawablePtr /*pDstDrawable*/,
1461.4Spooka		GCPtr /*pGC*/,
1471.4Spooka		int /*srcx*/,
1481.4Spooka		int /*srcy*/,
1491.4Spooka		int /*width*/,
1501.4Spooka		int /*height*/,
1511.4Spooka		int /*dstx*/,
1521.4Spooka		int /*dsty*/,
1531.4Spooka		unsigned long /*bitPlane*/);
1541.4Spooka    void	(* PolyPoint)(
1551.4Spooka		DrawablePtr /*pDrawable*/,
1561.4Spooka		GCPtr /*pGC*/,
1571.4Spooka		int /*mode*/,
1581.4Spooka		int /*npt*/,
1591.4Spooka		DDXPointPtr /*pptInit*/);
1601.4Spooka
1611.4Spooka    void	(* Polylines)(
1621.4Spooka		DrawablePtr /*pDrawable*/,
1631.4Spooka		GCPtr /*pGC*/,
1641.4Spooka		int /*mode*/,
1651.4Spooka		int /*npt*/,
1661.4Spooka		DDXPointPtr /*pptInit*/);
1671.4Spooka
1681.4Spooka    void	(* PolySegment)(
1691.4Spooka		DrawablePtr /*pDrawable*/,
1701.4Spooka		GCPtr /*pGC*/,
1711.4Spooka		int /*nseg*/,
1721.4Spooka		xSegment * /*pSegs*/);
1731.4Spooka
1741.4Spooka    void	(* PolyRectangle)(
1751.4Spooka		DrawablePtr /*pDrawable*/,
1761.4Spooka		GCPtr /*pGC*/,
1771.4Spooka		int /*nrects*/,
1781.4Spooka		xRectangle * /*pRects*/);
1791.4Spooka
1801.4Spooka    void	(* PolyArc)(
1811.4Spooka		DrawablePtr /*pDrawable*/,
1821.4Spooka		GCPtr /*pGC*/,
1831.4Spooka		int /*narcs*/,
1841.4Spooka		xArc * /*parcs*/);
1851.4Spooka
1861.4Spooka    void	(* FillPolygon)(
1871.4Spooka		DrawablePtr /*pDrawable*/,
1881.4Spooka		GCPtr /*pGC*/,
189		int /*shape*/,
190		int /*mode*/,
191		int /*count*/,
192		DDXPointPtr /*pPts*/);
193
194    void	(* PolyFillRect)(
195		DrawablePtr /*pDrawable*/,
196		GCPtr /*pGC*/,
197		int /*nrectFill*/,
198		xRectangle * /*prectInit*/);
199
200    void	(* PolyFillArc)(
201		DrawablePtr /*pDrawable*/,
202		GCPtr /*pGC*/,
203		int /*narcs*/,
204		xArc * /*parcs*/);
205
206    int		(* PolyText8)(
207		DrawablePtr /*pDrawable*/,
208		GCPtr /*pGC*/,
209		int /*x*/,
210		int /*y*/,
211		int /*count*/,
212		char * /*chars*/);
213
214    int		(* PolyText16)(
215		DrawablePtr /*pDrawable*/,
216		GCPtr /*pGC*/,
217		int /*x*/,
218		int /*y*/,
219		int /*count*/,
220		unsigned short * /*chars*/);
221
222    void	(* ImageText8)(
223		DrawablePtr /*pDrawable*/,
224		GCPtr /*pGC*/,
225		int /*x*/,
226		int /*y*/,
227		int /*count*/,
228		char * /*chars*/);
229
230    void	(* ImageText16)(
231		DrawablePtr /*pDrawable*/,
232		GCPtr /*pGC*/,
233		int /*x*/,
234		int /*y*/,
235		int /*count*/,
236		unsigned short * /*chars*/);
237
238    void	(* ImageGlyphBlt)(
239		DrawablePtr /*pDrawable*/,
240		GCPtr /*pGC*/,
241		int /*x*/,
242		int /*y*/,
243		unsigned int /*nglyph*/,
244		CharInfoPtr * /*ppci*/,
245		pointer /*pglyphBase*/);
246
247    void	(* PolyGlyphBlt)(
248		DrawablePtr /*pDrawable*/,
249		GCPtr /*pGC*/,
250		int /*x*/,
251		int /*y*/,
252		unsigned int /*nglyph*/,
253		CharInfoPtr * /*ppci*/,
254		pointer /*pglyphBase*/);
255
256    void	(* PushPixels)(
257		GCPtr /*pGC*/,
258		PixmapPtr /*pBitMap*/,
259		DrawablePtr /*pDst*/,
260		int /*w*/,
261		int /*h*/,
262		int /*x*/,
263		int /*y*/);
264
265    DevUnion	devPrivate;
266} GCOps;
267
268/* there is padding in the bit fields because the Sun compiler doesn't
269 * force alignment to 32-bit boundaries.  losers.
270 */
271typedef struct _GC {
272    ScreenPtr		pScreen;
273    unsigned char	depth;
274    unsigned char	alu;
275    unsigned short	lineWidth;
276    unsigned short	dashOffset;
277    unsigned short	numInDashList;
278    unsigned char	*dash;
279    unsigned int	lineStyle : 2;
280    unsigned int	capStyle : 2;
281    unsigned int	joinStyle : 2;
282    unsigned int	fillStyle : 2;
283    unsigned int	fillRule : 1;
284    unsigned int 	arcMode : 1;
285    unsigned int	subWindowMode : 1;
286    unsigned int	graphicsExposures : 1;
287    unsigned int	clientClipType : 2; /* CT_<kind> */
288    unsigned int	miTranslate:1; /* should mi things translate? */
289    unsigned int	tileIsPixel:1; /* tile is solid pixel */
290    unsigned int	fExpose:1;     /* Call exposure handling */
291    unsigned int	freeCompClip:1;  /* Free composite clip */
292    unsigned int	unused:14; /* see comment above */
293    unsigned long	planemask;
294    unsigned long	fgPixel;
295    unsigned long	bgPixel;
296    /*
297     * alas -- both tile and stipple must be here as they
298     * are independently specifiable
299     */
300    PixUnion		tile;
301    PixmapPtr		stipple;
302    DDXPointRec		patOrg;		/* origin for (tile, stipple) */
303    struct _Font	*font;
304    DDXPointRec		clipOrg;
305    DDXPointRec		lastWinOrg;	/* position of window last validated */
306    pointer		clientClip;
307    unsigned long	stateChanges;	/* masked with GC_<kind> */
308    unsigned long       serialNumber;
309    GCFuncs		*funcs;
310    GCOps		*ops;
311    DevUnion		*devPrivates;
312    /*
313     * The following were moved here from private storage to allow device-
314     * independent access to them from screen wrappers.
315     * --- 1997.11.03  Marc Aurele La France (tsi@xfree86.org)
316     */
317    PixmapPtr		pRotatedPixmap; /* tile/stipple rotated for alignment */
318    RegionPtr		pCompositeClip;
319    /* fExpose & freeCompClip defined above */
320} GC;
321
322#endif /* GCSTRUCT_H */
323