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