gcstruct.h revision 4642e01f
105b261ecSmrg/***********************************************************
205b261ecSmrg
305b261ecSmrgCopyright 1987, 1998  The Open Group
405b261ecSmrg
505b261ecSmrgPermission to use, copy, modify, distribute, and sell this software and its
605b261ecSmrgdocumentation for any purpose is hereby granted without fee, provided that
705b261ecSmrgthe above copyright notice appear in all copies and that both that
805b261ecSmrgcopyright notice and this permission notice appear in supporting
905b261ecSmrgdocumentation.
1005b261ecSmrg
1105b261ecSmrgThe above copyright notice and this permission notice shall be included in
1205b261ecSmrgall copies or substantial portions of the Software.
1305b261ecSmrg
1405b261ecSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1505b261ecSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1605b261ecSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1705b261ecSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1805b261ecSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1905b261ecSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2005b261ecSmrg
2105b261ecSmrgExcept as contained in this notice, the name of The Open Group shall not be
2205b261ecSmrgused in advertising or otherwise to promote the sale, use or other dealings
2305b261ecSmrgin this Software without prior written authorization from The Open Group.
2405b261ecSmrg
2505b261ecSmrg
2605b261ecSmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
2705b261ecSmrg
2805b261ecSmrg                        All Rights Reserved
2905b261ecSmrg
3005b261ecSmrgPermission to use, copy, modify, and distribute this software and its
3105b261ecSmrgdocumentation for any purpose and without fee is hereby granted,
3205b261ecSmrgprovided that the above copyright notice appear in all copies and that
3305b261ecSmrgboth that copyright notice and this permission notice appear in
3405b261ecSmrgsupporting documentation, and that the name of Digital not be
3505b261ecSmrgused in advertising or publicity pertaining to distribution of the
3605b261ecSmrgsoftware without specific, written prior permission.
3705b261ecSmrg
3805b261ecSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
3905b261ecSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
4005b261ecSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
4105b261ecSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
4205b261ecSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
4305b261ecSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
4405b261ecSmrgSOFTWARE.
4505b261ecSmrg
4605b261ecSmrg******************************************************************/
4705b261ecSmrg
4805b261ecSmrg
4905b261ecSmrg
5005b261ecSmrg#ifndef GCSTRUCT_H
5105b261ecSmrg#define GCSTRUCT_H
5205b261ecSmrg
5305b261ecSmrg#include "gc.h"
5405b261ecSmrg
5505b261ecSmrg#include "regionstr.h"
5605b261ecSmrg#include "region.h"
5705b261ecSmrg#include "pixmap.h"
5805b261ecSmrg#include "screenint.h"
594642e01fSmrg#include "privates.h"
6005b261ecSmrg#include <X11/Xprotostr.h>
6105b261ecSmrg
6205b261ecSmrg/*
6305b261ecSmrg * functions which modify the state of the GC
6405b261ecSmrg */
6505b261ecSmrg
6605b261ecSmrgtypedef struct _GCFuncs {
6705b261ecSmrg    void	(* ValidateGC)(
6805b261ecSmrg		GCPtr /*pGC*/,
6905b261ecSmrg		unsigned long /*stateChanges*/,
7005b261ecSmrg		DrawablePtr /*pDrawable*/);
7105b261ecSmrg
7205b261ecSmrg    void	(* ChangeGC)(
7305b261ecSmrg		GCPtr /*pGC*/,
7405b261ecSmrg		unsigned long /*mask*/);
7505b261ecSmrg
7605b261ecSmrg    void	(* CopyGC)(
7705b261ecSmrg		GCPtr /*pGCSrc*/,
7805b261ecSmrg		unsigned long /*mask*/,
7905b261ecSmrg		GCPtr /*pGCDst*/);
8005b261ecSmrg
8105b261ecSmrg    void	(* DestroyGC)(
8205b261ecSmrg		GCPtr /*pGC*/);
8305b261ecSmrg
8405b261ecSmrg    void	(* ChangeClip)(
8505b261ecSmrg		GCPtr /*pGC*/,
8605b261ecSmrg		int /*type*/,
8705b261ecSmrg		pointer /*pvalue*/,
8805b261ecSmrg		int /*nrects*/);
8905b261ecSmrg
9005b261ecSmrg    void	(* DestroyClip)(
9105b261ecSmrg		GCPtr /*pGC*/);
9205b261ecSmrg
9305b261ecSmrg    void	(* CopyClip)(
9405b261ecSmrg		GCPtr /*pgcDst*/,
9505b261ecSmrg		GCPtr /*pgcSrc*/);
9605b261ecSmrg    DevUnion	devPrivate;
9705b261ecSmrg} GCFuncs;
9805b261ecSmrg
9905b261ecSmrg/*
10005b261ecSmrg * graphics operations invoked through a GC
10105b261ecSmrg */
10205b261ecSmrg
10305b261ecSmrgtypedef struct _GCOps {
10405b261ecSmrg    void	(* FillSpans)(
10505b261ecSmrg		DrawablePtr /*pDrawable*/,
10605b261ecSmrg		GCPtr /*pGC*/,
10705b261ecSmrg		int /*nInit*/,
10805b261ecSmrg		DDXPointPtr /*pptInit*/,
10905b261ecSmrg		int * /*pwidthInit*/,
11005b261ecSmrg		int /*fSorted*/);
11105b261ecSmrg
11205b261ecSmrg    void	(* SetSpans)(
11305b261ecSmrg		DrawablePtr /*pDrawable*/,
11405b261ecSmrg		GCPtr /*pGC*/,
11505b261ecSmrg		char * /*psrc*/,
11605b261ecSmrg		DDXPointPtr /*ppt*/,
11705b261ecSmrg		int * /*pwidth*/,
11805b261ecSmrg		int /*nspans*/,
11905b261ecSmrg		int /*fSorted*/);
12005b261ecSmrg
12105b261ecSmrg    void	(* PutImage)(
12205b261ecSmrg		DrawablePtr /*pDrawable*/,
12305b261ecSmrg		GCPtr /*pGC*/,
12405b261ecSmrg		int /*depth*/,
12505b261ecSmrg		int /*x*/,
12605b261ecSmrg		int /*y*/,
12705b261ecSmrg		int /*w*/,
12805b261ecSmrg		int /*h*/,
12905b261ecSmrg		int /*leftPad*/,
13005b261ecSmrg		int /*format*/,
13105b261ecSmrg		char * /*pBits*/);
13205b261ecSmrg
13305b261ecSmrg    RegionPtr	(* CopyArea)(
13405b261ecSmrg		DrawablePtr /*pSrc*/,
13505b261ecSmrg		DrawablePtr /*pDst*/,
13605b261ecSmrg		GCPtr /*pGC*/,
13705b261ecSmrg		int /*srcx*/,
13805b261ecSmrg		int /*srcy*/,
13905b261ecSmrg		int /*w*/,
14005b261ecSmrg		int /*h*/,
14105b261ecSmrg		int /*dstx*/,
14205b261ecSmrg		int /*dsty*/);
14305b261ecSmrg
14405b261ecSmrg    RegionPtr	(* CopyPlane)(
14505b261ecSmrg		DrawablePtr /*pSrcDrawable*/,
14605b261ecSmrg		DrawablePtr /*pDstDrawable*/,
14705b261ecSmrg		GCPtr /*pGC*/,
14805b261ecSmrg		int /*srcx*/,
14905b261ecSmrg		int /*srcy*/,
15005b261ecSmrg		int /*width*/,
15105b261ecSmrg		int /*height*/,
15205b261ecSmrg		int /*dstx*/,
15305b261ecSmrg		int /*dsty*/,
15405b261ecSmrg		unsigned long /*bitPlane*/);
15505b261ecSmrg    void	(* PolyPoint)(
15605b261ecSmrg		DrawablePtr /*pDrawable*/,
15705b261ecSmrg		GCPtr /*pGC*/,
15805b261ecSmrg		int /*mode*/,
15905b261ecSmrg		int /*npt*/,
16005b261ecSmrg		DDXPointPtr /*pptInit*/);
16105b261ecSmrg
16205b261ecSmrg    void	(* Polylines)(
16305b261ecSmrg		DrawablePtr /*pDrawable*/,
16405b261ecSmrg		GCPtr /*pGC*/,
16505b261ecSmrg		int /*mode*/,
16605b261ecSmrg		int /*npt*/,
16705b261ecSmrg		DDXPointPtr /*pptInit*/);
16805b261ecSmrg
16905b261ecSmrg    void	(* PolySegment)(
17005b261ecSmrg		DrawablePtr /*pDrawable*/,
17105b261ecSmrg		GCPtr /*pGC*/,
17205b261ecSmrg		int /*nseg*/,
17305b261ecSmrg		xSegment * /*pSegs*/);
17405b261ecSmrg
17505b261ecSmrg    void	(* PolyRectangle)(
17605b261ecSmrg		DrawablePtr /*pDrawable*/,
17705b261ecSmrg		GCPtr /*pGC*/,
17805b261ecSmrg		int /*nrects*/,
17905b261ecSmrg		xRectangle * /*pRects*/);
18005b261ecSmrg
18105b261ecSmrg    void	(* PolyArc)(
18205b261ecSmrg		DrawablePtr /*pDrawable*/,
18305b261ecSmrg		GCPtr /*pGC*/,
18405b261ecSmrg		int /*narcs*/,
18505b261ecSmrg		xArc * /*parcs*/);
18605b261ecSmrg
18705b261ecSmrg    void	(* FillPolygon)(
18805b261ecSmrg		DrawablePtr /*pDrawable*/,
18905b261ecSmrg		GCPtr /*pGC*/,
19005b261ecSmrg		int /*shape*/,
19105b261ecSmrg		int /*mode*/,
19205b261ecSmrg		int /*count*/,
19305b261ecSmrg		DDXPointPtr /*pPts*/);
19405b261ecSmrg
19505b261ecSmrg    void	(* PolyFillRect)(
19605b261ecSmrg		DrawablePtr /*pDrawable*/,
19705b261ecSmrg		GCPtr /*pGC*/,
19805b261ecSmrg		int /*nrectFill*/,
19905b261ecSmrg		xRectangle * /*prectInit*/);
20005b261ecSmrg
20105b261ecSmrg    void	(* PolyFillArc)(
20205b261ecSmrg		DrawablePtr /*pDrawable*/,
20305b261ecSmrg		GCPtr /*pGC*/,
20405b261ecSmrg		int /*narcs*/,
20505b261ecSmrg		xArc * /*parcs*/);
20605b261ecSmrg
20705b261ecSmrg    int		(* PolyText8)(
20805b261ecSmrg		DrawablePtr /*pDrawable*/,
20905b261ecSmrg		GCPtr /*pGC*/,
21005b261ecSmrg		int /*x*/,
21105b261ecSmrg		int /*y*/,
21205b261ecSmrg		int /*count*/,
21305b261ecSmrg		char * /*chars*/);
21405b261ecSmrg
21505b261ecSmrg    int		(* PolyText16)(
21605b261ecSmrg		DrawablePtr /*pDrawable*/,
21705b261ecSmrg		GCPtr /*pGC*/,
21805b261ecSmrg		int /*x*/,
21905b261ecSmrg		int /*y*/,
22005b261ecSmrg		int /*count*/,
22105b261ecSmrg		unsigned short * /*chars*/);
22205b261ecSmrg
22305b261ecSmrg    void	(* ImageText8)(
22405b261ecSmrg		DrawablePtr /*pDrawable*/,
22505b261ecSmrg		GCPtr /*pGC*/,
22605b261ecSmrg		int /*x*/,
22705b261ecSmrg		int /*y*/,
22805b261ecSmrg		int /*count*/,
22905b261ecSmrg		char * /*chars*/);
23005b261ecSmrg
23105b261ecSmrg    void	(* ImageText16)(
23205b261ecSmrg		DrawablePtr /*pDrawable*/,
23305b261ecSmrg		GCPtr /*pGC*/,
23405b261ecSmrg		int /*x*/,
23505b261ecSmrg		int /*y*/,
23605b261ecSmrg		int /*count*/,
23705b261ecSmrg		unsigned short * /*chars*/);
23805b261ecSmrg
23905b261ecSmrg    void	(* ImageGlyphBlt)(
24005b261ecSmrg		DrawablePtr /*pDrawable*/,
24105b261ecSmrg		GCPtr /*pGC*/,
24205b261ecSmrg		int /*x*/,
24305b261ecSmrg		int /*y*/,
24405b261ecSmrg		unsigned int /*nglyph*/,
24505b261ecSmrg		CharInfoPtr * /*ppci*/,
24605b261ecSmrg		pointer /*pglyphBase*/);
24705b261ecSmrg
24805b261ecSmrg    void	(* PolyGlyphBlt)(
24905b261ecSmrg		DrawablePtr /*pDrawable*/,
25005b261ecSmrg		GCPtr /*pGC*/,
25105b261ecSmrg		int /*x*/,
25205b261ecSmrg		int /*y*/,
25305b261ecSmrg		unsigned int /*nglyph*/,
25405b261ecSmrg		CharInfoPtr * /*ppci*/,
25505b261ecSmrg		pointer /*pglyphBase*/);
25605b261ecSmrg
25705b261ecSmrg    void	(* PushPixels)(
25805b261ecSmrg		GCPtr /*pGC*/,
25905b261ecSmrg		PixmapPtr /*pBitMap*/,
26005b261ecSmrg		DrawablePtr /*pDst*/,
26105b261ecSmrg		int /*w*/,
26205b261ecSmrg		int /*h*/,
26305b261ecSmrg		int /*x*/,
26405b261ecSmrg		int /*y*/);
26505b261ecSmrg
26605b261ecSmrg    DevUnion	devPrivate;
26705b261ecSmrg} GCOps;
26805b261ecSmrg
26905b261ecSmrg/* there is padding in the bit fields because the Sun compiler doesn't
27005b261ecSmrg * force alignment to 32-bit boundaries.  losers.
27105b261ecSmrg */
27205b261ecSmrgtypedef struct _GC {
27305b261ecSmrg    ScreenPtr		pScreen;
27405b261ecSmrg    unsigned char	depth;
27505b261ecSmrg    unsigned char	alu;
27605b261ecSmrg    unsigned short	lineWidth;
27705b261ecSmrg    unsigned short	dashOffset;
27805b261ecSmrg    unsigned short	numInDashList;
27905b261ecSmrg    unsigned char	*dash;
28005b261ecSmrg    unsigned int	lineStyle : 2;
28105b261ecSmrg    unsigned int	capStyle : 2;
28205b261ecSmrg    unsigned int	joinStyle : 2;
28305b261ecSmrg    unsigned int	fillStyle : 2;
28405b261ecSmrg    unsigned int	fillRule : 1;
28505b261ecSmrg    unsigned int 	arcMode : 1;
28605b261ecSmrg    unsigned int	subWindowMode : 1;
28705b261ecSmrg    unsigned int	graphicsExposures : 1;
28805b261ecSmrg    unsigned int	clientClipType : 2; /* CT_<kind> */
28905b261ecSmrg    unsigned int	miTranslate:1; /* should mi things translate? */
29005b261ecSmrg    unsigned int	tileIsPixel:1; /* tile is solid pixel */
29105b261ecSmrg    unsigned int	fExpose:1;     /* Call exposure handling */
29205b261ecSmrg    unsigned int	freeCompClip:1;  /* Free composite clip */
29305b261ecSmrg    unsigned int	unused:14; /* see comment above */
29405b261ecSmrg    unsigned long	planemask;
29505b261ecSmrg    unsigned long	fgPixel;
29605b261ecSmrg    unsigned long	bgPixel;
29705b261ecSmrg    /*
29805b261ecSmrg     * alas -- both tile and stipple must be here as they
29905b261ecSmrg     * are independently specifiable
30005b261ecSmrg     */
30105b261ecSmrg    PixUnion		tile;
30205b261ecSmrg    PixmapPtr		stipple;
30305b261ecSmrg    DDXPointRec		patOrg;		/* origin for (tile, stipple) */
30405b261ecSmrg    struct _Font	*font;
30505b261ecSmrg    DDXPointRec		clipOrg;
30605b261ecSmrg    DDXPointRec		lastWinOrg;	/* position of window last validated */
30705b261ecSmrg    pointer		clientClip;
30805b261ecSmrg    unsigned long	stateChanges;	/* masked with GC_<kind> */
30905b261ecSmrg    unsigned long       serialNumber;
31005b261ecSmrg    GCFuncs		*funcs;
31105b261ecSmrg    GCOps		*ops;
3124642e01fSmrg    PrivateRec		*devPrivates;
31305b261ecSmrg    /*
31405b261ecSmrg     * The following were moved here from private storage to allow device-
31505b261ecSmrg     * independent access to them from screen wrappers.
31605b261ecSmrg     * --- 1997.11.03  Marc Aurele La France (tsi@xfree86.org)
31705b261ecSmrg     */
31805b261ecSmrg    PixmapPtr		pRotatedPixmap; /* tile/stipple rotated for alignment */
31905b261ecSmrg    RegionPtr		pCompositeClip;
32005b261ecSmrg    /* fExpose & freeCompClip defined above */
32105b261ecSmrg} GC;
32205b261ecSmrg
32305b261ecSmrg#endif /* GCSTRUCT_H */
324