45e9809aff7304721fddb95654901b32195c9c7avboxsync/***********************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1987, 1998 The Open Group
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncthe above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsynccopyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncThe above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncall copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45e9809aff7304721fddb95654901b32195c9c7avboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncExcept as contained in this notice, the name of The Open Group shall not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or otherwise to promote the sale, use or other dealings
45e9809aff7304721fddb95654901b32195c9c7avboxsyncin this Software without prior written authorization from The Open Group.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync All Rights Reserved
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, and distribute this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose and without fee is hereby granted,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncprovided that the above copyright notice appear in all copies and that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncboth that copyright notice and this permission notice appear in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsupporting documentation, and that the name of Digital not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or publicity pertaining to distribution of the
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsoftware without specific, written prior permission.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
45e9809aff7304721fddb95654901b32195c9c7avboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45e9809aff7304721fddb95654901b32195c9c7avboxsyncSOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync******************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef GC_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GC_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/X.h> /* for GContext, Mask */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xdefs.h> /* for Bool */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xproto.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "screenint.h" /* for ScreenPtr */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "pixmap.h" /* for DrawablePtr */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* clientClipType field in GC */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_NONE 0
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_PIXMAP 1
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_REGION 2
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_UNSORTED 6
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_YSORTED 10
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_YXSORTED 14
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CT_YXBANDED 18
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCQREASON_VALIDATE 1
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCQREASON_CHANGE 2
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCQREASON_COPY_SRC 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCQREASON_COPY_DST 4
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCQREASON_DESTROY 5
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GC_CALL_VALIDATE_BIT (1L<<30)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define GCExtensionInterest (1L<<29)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MAX_SERIAL_NUM (1L<<28)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (globalSerialNumber = 1): globalSerialNumber)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _GCInterest *GCInterestPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _GC *GCPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _GCOps *GCOpsPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void ValidateGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DrawablePtr /*pDraw*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr /*pGC*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int ChangeGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr/*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BITS32 /*mask*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID* /*pval*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int DoChangeGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr/*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BITS32 /*mask*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID* /*pval*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*fPointer*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef union {
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 val;
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer ptr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} ChangeGCVal, *ChangeGCValPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int dixChangeGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /*client*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr /*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BITS32 /*mask*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 * /*pval*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ChangeGCValPtr /*pCGCV*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern GCPtr CreateGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DrawablePtr /*pDrawable*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BITS32 /*mask*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID* /*pval*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int* /*pStatus*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int CopyGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr/*pgcSrc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr/*pgcDst*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BITS32 /*mask*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int FreeGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer /*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID /*gid*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern GCPtr CreateScratchGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenPtr /*pScreen*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*depth*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void FreeGCperDepth(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*screenNum*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool CreateGCperDepth(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*screenNum*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool CreateDefaultStipple(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*screenNum*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void FreeDefaultStipple(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*screenNum*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int SetDashes(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr /*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*offset*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*ndash*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char* /*pdash*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int VerifyRectOrder(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*nrects*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRectangle* /*prects*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*ordering*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int SetClipRects(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr /*pGC*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*xOrigin*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*yOrigin*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*nrects*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRectangle* /*prects*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*ordering*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern GCPtr GetScratchGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*depth*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenPtr /*pScreen*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void FreeScratchGC(
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCPtr /*pGC*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* GC_H */