1 | /* $XFree86$ */
|
---|
2 | /*
|
---|
3 | * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
|
---|
4 | *
|
---|
5 | * All Rights Reserved.
|
---|
6 | *
|
---|
7 | * Permission is hereby granted, free of charge, to any person obtaining
|
---|
8 | * a copy of this software and associated documentation files (the
|
---|
9 | * "Software"), to deal in the Software without restriction, including
|
---|
10 | * without limitation on the rights to use, copy, modify, merge,
|
---|
11 | * publish, distribute, sublicense, and/or sell copies of the Software,
|
---|
12 | * and to permit persons to whom the Software is furnished to do so,
|
---|
13 | * subject to the following conditions:
|
---|
14 | *
|
---|
15 | * The above copyright notice and this permission notice (including the
|
---|
16 | * next paragraph) shall be included in all copies or substantial
|
---|
17 | * portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
22 | * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
|
---|
23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
---|
24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
---|
26 | * SOFTWARE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * Authors:
|
---|
31 | * Kevin E. Martin <kem@redhat.com>
|
---|
32 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | /** \file
|
---|
36 | * Interface for GC support. \see dmxgc.c */
|
---|
37 |
|
---|
38 | #ifndef DMXGC_H
|
---|
39 | #define DMXGC_H
|
---|
40 |
|
---|
41 | #include "gcstruct.h"
|
---|
42 |
|
---|
43 | /** GC private area. */
|
---|
44 | typedef struct _dmxGCPriv {
|
---|
45 | GCOps *ops;
|
---|
46 | GCFuncs *funcs;
|
---|
47 | XlibGC gc;
|
---|
48 | Bool msc;
|
---|
49 | } dmxGCPrivRec, *dmxGCPrivPtr;
|
---|
50 |
|
---|
51 |
|
---|
52 | extern Bool dmxInitGC(ScreenPtr pScreen);
|
---|
53 |
|
---|
54 | extern Bool dmxCreateGC(GCPtr pGC);
|
---|
55 | extern void dmxValidateGC(GCPtr pGC, unsigned long changes,
|
---|
56 | DrawablePtr pDrawable);
|
---|
57 | extern void dmxChangeGC(GCPtr pGC, unsigned long mask);
|
---|
58 | extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst);
|
---|
59 | extern void dmxDestroyGC(GCPtr pGC);
|
---|
60 | extern void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
|
---|
61 | extern void dmxDestroyClip(GCPtr pGC);
|
---|
62 | extern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
|
---|
63 |
|
---|
64 | extern void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC);
|
---|
65 | extern Bool dmxBEFreeGC(GCPtr pGC);
|
---|
66 |
|
---|
67 | /** Private index. \see dmxgc.c \see dmxscrinit.c */
|
---|
68 | extern int dmxGCPrivateIndex;
|
---|
69 |
|
---|
70 | /** Get private. */
|
---|
71 | #define DMX_GET_GC_PRIV(_pGC) \
|
---|
72 | (dmxGCPrivPtr)(_pGC)->devPrivates[dmxGCPrivateIndex].ptr
|
---|
73 |
|
---|
74 | #define DMX_GC_FUNC_PROLOGUE(_pGC) \
|
---|
75 | do { \
|
---|
76 | dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \
|
---|
77 | DMX_UNWRAP(funcs, _pGCPriv, (_pGC)); \
|
---|
78 | if (_pGCPriv->ops) \
|
---|
79 | DMX_UNWRAP(ops, _pGCPriv, (_pGC)); \
|
---|
80 | } while (0)
|
---|
81 |
|
---|
82 | #define DMX_GC_FUNC_EPILOGUE(_pGC) \
|
---|
83 | do { \
|
---|
84 | dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \
|
---|
85 | DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \
|
---|
86 | if (_pGCPriv->ops) \
|
---|
87 | DMX_WRAP(ops, &dmxGCOps, _pGCPriv, (_pGC)); \
|
---|
88 | } while (0)
|
---|
89 |
|
---|
90 | #endif /* DMXGC_H */
|
---|