Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

# dmxgc.h

Go to the documentation of this file.

    00001 /* $XFree86$ */
    00002 /*
    00003  * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
    00004  *
    00005  * All Rights Reserved.
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining
    00008  * a copy of this software and associated documentation files (the
    00009  * "Software"), to deal in the Software without restriction, including
    00010  * without limitation on the rights to use, copy, modify, merge,
    00011  * publish, distribute, sublicense, and/or sell copies of the Software,
    00012  * and to permit persons to whom the Software is furnished to do so,
    00013  * subject to the following conditions:
    00014  *
    00015  * The above copyright notice and this permission notice (including the
    00016  * next paragraph) shall be included in all copies or substantial
    00017  * portions of the Software.
    00018  *
    00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00020  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00021  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    00022  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
    00023  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    00024  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00025  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    00026  * SOFTWARE.
    00027  */
    00028
    00029 /*
    00030  * Authors:
    00031  *   Kevin E. Martin <kem@redhat.com>
    00032  *
    00033  */
    00034
    00038 #ifndef DMXGC_H
    00039 #define DMXGC_H
    00040
    00041 #include "gcstruct.h"
    00042
    00044 typedef struct _dmxGCPriv {
    00045     GCOps   *ops;
    00046     GCFuncs *funcs;
    00047     XlibGC   gc;
    00048     Bool     msc;
    00049 } dmxGCPrivRec, *dmxGCPrivPtr;
    00050
    00051
    00052 extern Bool dmxInitGC(ScreenPtr pScreen);
    00053
    00054 extern Bool dmxCreateGC(GCPtr pGC);
    00055 extern void dmxValidateGC(GCPtr pGC, unsigned long changes,
    00056                           DrawablePtr pDrawable);
    00057 extern void dmxChangeGC(GCPtr pGC, unsigned long mask);
    00058 extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst);
    00059 extern void dmxDestroyGC(GCPtr pGC);
    00060 extern void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
    00061 extern void dmxDestroyClip(GCPtr pGC);
    00062 extern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
    00063
    00064 extern void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC);
    00065 extern Bool dmxBEFreeGC(GCPtr pGC);
    00066
    00068 extern int dmxGCPrivateIndex;
    00069
    00071 #define DMX_GET_GC_PRIV(_pGC)                                           \
    00072     (dmxGCPrivPtr)(_pGC)->devPrivates[dmxGCPrivateIndex].ptr
    00073
    00074 #define DMX_GC_FUNC_PROLOGUE(_pGC)                                      \
    00075 do {                                                                    \
    00076     dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC);                      \
    00077     DMX_UNWRAP(funcs, _pGCPriv, (_pGC));                                \
    00078     if (_pGCPriv->ops)                                                  \
    00079         DMX_UNWRAP(ops, _pGCPriv, (_pGC));                              \
    00080 } while (0)
    00081
    00082 #define DMX_GC_FUNC_EPILOGUE(_pGC)                                      \
    00083 do {                                                                    \
    00084     dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC);                      \
    00085     DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC));                     \
    00086     if (_pGCPriv->ops)                                                  \
    00087         DMX_WRAP(ops, &dmxGCOps, _pGCPriv, (_pGC));                     \
    00088 } while (0)
    00089
    00090 #endif /* DMXGC_H */