deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* $XFree86$ */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * All Rights Reserved.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * a copy of this software and associated documentation files (the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * "Software"), to deal in the Software without restriction, including
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * without limitation on the rights to use, copy, modify, merge,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and to permit persons to whom the Software is furnished to do so,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice (including the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * next paragraph) shall be included in all copies or substantial
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Authors:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Kevin E. Martin <kem@redhat.com>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** \file
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Interface for GC support. \see dmxgc.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef DMXGC_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMXGC_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include "gcstruct.h"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** GC private area. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _dmxGCPriv {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GCOps *ops;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync GCFuncs *funcs;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync XlibGC gc;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool msc;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} dmxGCPrivRec, *dmxGCPrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxInitGC(ScreenPtr pScreen);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxCreateGC(GCPtr pGC);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxValidateGC(GCPtr pGC, unsigned long changes,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DrawablePtr pDrawable);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxChangeGC(GCPtr pGC, unsigned long mask);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxDestroyGC(GCPtr pGC);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxDestroyClip(GCPtr pGC);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern Bool dmxBEFreeGC(GCPtr pGC);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Private index. \see dmxgc.c \see dmxscrinit.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxGCPrivateIndex;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Get private. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_GET_GC_PRIV(_pGC) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (dmxGCPrivPtr)(_pGC)->devPrivates[dmxGCPrivateIndex].ptr
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_GC_FUNC_PROLOGUE(_pGC) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdo { \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMX_UNWRAP(funcs, _pGCPriv, (_pGC)); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync if (_pGCPriv->ops) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMX_UNWRAP(ops, _pGCPriv, (_pGC)); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} while (0)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_GC_FUNC_EPILOGUE(_pGC) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdo { \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync if (_pGCPriv->ops) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMX_WRAP(ops, &dmxGCOps, _pGCPriv, (_pGC)); \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} while (0)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* DMXGC_H */