1 | /*
|
---|
2 | * $Id$
|
---|
3 | *
|
---|
4 | * Copyright © 2003 Keith Packard
|
---|
5 | *
|
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | * the above copyright notice appear in all copies and that both that
|
---|
9 | * copyright notice and this permission notice appear in supporting
|
---|
10 | * documentation, and that the name of Keith Packard not be used in
|
---|
11 | * advertising or publicity pertaining to distribution of the software without
|
---|
12 | * specific, written prior permission. Keith Packard makes no
|
---|
13 | * representations about the suitability of this software for any purpose. It
|
---|
14 | * is provided "as is" without express or implied warranty.
|
---|
15 | *
|
---|
16 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
18 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
22 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
23 | */
|
---|
24 |
|
---|
25 | #ifdef HAVE_DIX_CONFIG_H
|
---|
26 | #include <dix-config.h>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #ifndef _DAMAGESTR_H_
|
---|
30 | #define _DAMAGESTR_H_
|
---|
31 |
|
---|
32 | #include "damage.h"
|
---|
33 | #include "gcstruct.h"
|
---|
34 | #ifdef RENDER
|
---|
35 | # include "picturestr.h"
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | typedef struct _damage {
|
---|
39 | DamagePtr pNext;
|
---|
40 | DamagePtr pNextWin;
|
---|
41 | RegionRec damage;
|
---|
42 |
|
---|
43 | DamageReportLevel damageLevel;
|
---|
44 | Bool isInternal;
|
---|
45 | void *closure;
|
---|
46 | Bool isWindow;
|
---|
47 | DrawablePtr pDrawable;
|
---|
48 |
|
---|
49 | DamageReportFunc damageReport;
|
---|
50 | DamageDestroyFunc damageDestroy;
|
---|
51 |
|
---|
52 | Bool reportAfter;
|
---|
53 | RegionRec pendingDamage;
|
---|
54 | } DamageRec;
|
---|
55 |
|
---|
56 | typedef struct _damageScrPriv {
|
---|
57 | int internalLevel;
|
---|
58 |
|
---|
59 | /*
|
---|
60 | * For DDXen which don't provide GetScreenPixmap, this provides
|
---|
61 | * a place to hook damage for windows on the screen
|
---|
62 | */
|
---|
63 | DamagePtr pScreenDamage;
|
---|
64 |
|
---|
65 | PaintWindowBackgroundProcPtr PaintWindowBackground;
|
---|
66 | PaintWindowBorderProcPtr PaintWindowBorder;
|
---|
67 | CopyWindowProcPtr CopyWindow;
|
---|
68 | CloseScreenProcPtr CloseScreen;
|
---|
69 | CreateGCProcPtr CreateGC;
|
---|
70 | DestroyPixmapProcPtr DestroyPixmap;
|
---|
71 | SetWindowPixmapProcPtr SetWindowPixmap;
|
---|
72 | DestroyWindowProcPtr DestroyWindow;
|
---|
73 | #ifdef RENDER
|
---|
74 | CompositeProcPtr Composite;
|
---|
75 | GlyphsProcPtr Glyphs;
|
---|
76 | #endif
|
---|
77 | BSFuncRec BackingStoreFuncs;
|
---|
78 | } DamageScrPrivRec, *DamageScrPrivPtr;
|
---|
79 |
|
---|
80 | typedef struct _damageGCPriv {
|
---|
81 | GCOps *ops;
|
---|
82 | GCFuncs *funcs;
|
---|
83 | } DamageGCPrivRec, *DamageGCPrivPtr;
|
---|
84 |
|
---|
85 | extern int damageScrPrivateIndex;
|
---|
86 | extern int damagePixPrivateIndex;
|
---|
87 | extern int damageGCPrivateIndex;
|
---|
88 | extern int damageWinPrivateIndex;
|
---|
89 |
|
---|
90 | #define damageGetScrPriv(pScr) \
|
---|
91 | ((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)
|
---|
92 |
|
---|
93 | #define damageScrPriv(pScr) \
|
---|
94 | DamageScrPrivPtr pScrPriv = damageGetScrPriv(pScr)
|
---|
95 |
|
---|
96 | #define damageGetPixPriv(pPix) \
|
---|
97 | ((DamagePtr) (pPix)->devPrivates[damagePixPrivateIndex].ptr)
|
---|
98 |
|
---|
99 | #define damgeSetPixPriv(pPix,v) \
|
---|
100 | ((pPix)->devPrivates[damagePixPrivateIndex].ptr = (pointer ) (v))
|
---|
101 |
|
---|
102 | #define damagePixPriv(pPix) \
|
---|
103 | DamagePtr pDamage = damageGetPixPriv(pPix)
|
---|
104 |
|
---|
105 | #define damageGetGCPriv(pGC) \
|
---|
106 | ((DamageGCPrivPtr) (pGC)->devPrivates[damageGCPrivateIndex].ptr)
|
---|
107 |
|
---|
108 | #define damageGCPriv(pGC) \
|
---|
109 | DamageGCPrivPtr pGCPriv = damageGetGCPriv(pGC)
|
---|
110 |
|
---|
111 | #define damageGetWinPriv(pWin) \
|
---|
112 | ((DamagePtr) (pWin)->devPrivates[damageWinPrivateIndex].ptr)
|
---|
113 |
|
---|
114 | #define damageSetWinPriv(pWin,d) \
|
---|
115 | ((pWin)->devPrivates[damageWinPrivateIndex].ptr = (d))
|
---|
116 |
|
---|
117 | #endif /* _DAMAGESTR_H_ */
|
---|