1 | /*
|
---|
2 | *
|
---|
3 | * Copyright © 2000 Keith Packard
|
---|
4 | *
|
---|
5 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | * the above copyright notice appear in all copies and that both that
|
---|
8 | * copyright notice and this permission notice appear in supporting
|
---|
9 | * documentation, and that the name of Keith Packard not be used in
|
---|
10 | * advertising or publicity pertaining to distribution of the software without
|
---|
11 | * specific, written prior permission. Keith Packard makes no
|
---|
12 | * representations about the suitability of this software for any purpose. It
|
---|
13 | * is provided "as is" without express or implied warranty.
|
---|
14 | *
|
---|
15 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
17 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
19 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
20 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
21 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
22 | */
|
---|
23 |
|
---|
24 | #ifndef _SHADOW_H_
|
---|
25 | #define _SHADOW_H_
|
---|
26 |
|
---|
27 | #include "scrnintstr.h"
|
---|
28 |
|
---|
29 | #ifdef RENDER
|
---|
30 | #include "picturestr.h"
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include "damage.h"
|
---|
34 | #include "damagestr.h"
|
---|
35 | typedef struct _shadowBuf *shadowBufPtr;
|
---|
36 |
|
---|
37 | typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
|
---|
38 | shadowBufPtr pBuf);
|
---|
39 |
|
---|
40 | #define SHADOW_WINDOW_RELOCATE 1
|
---|
41 | #define SHADOW_WINDOW_READ 2
|
---|
42 | #define SHADOW_WINDOW_WRITE 4
|
---|
43 |
|
---|
44 | typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
|
---|
45 | CARD32 row,
|
---|
46 | CARD32 offset,
|
---|
47 | int mode,
|
---|
48 | CARD32 *size,
|
---|
49 | void *closure);
|
---|
50 |
|
---|
51 | /* BC hack: do not move the damage member. see shadow.c for explanation. */
|
---|
52 | typedef struct _shadowBuf {
|
---|
53 | DamagePtr pDamage;
|
---|
54 | ShadowUpdateProc update;
|
---|
55 | ShadowWindowProc window;
|
---|
56 | RegionRec damage;
|
---|
57 | PixmapPtr pPixmap;
|
---|
58 | void *closure;
|
---|
59 | int randr;
|
---|
60 |
|
---|
61 | /* screen wrappers */
|
---|
62 | GetImageProcPtr GetImage;
|
---|
63 | CloseScreenProcPtr CloseScreen;
|
---|
64 | } shadowBufRec;
|
---|
65 |
|
---|
66 | /* Match defines from randr extension */
|
---|
67 | #define SHADOW_ROTATE_0 1
|
---|
68 | #define SHADOW_ROTATE_90 2
|
---|
69 | #define SHADOW_ROTATE_180 4
|
---|
70 | #define SHADOW_ROTATE_270 8
|
---|
71 | #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
|
---|
72 | SHADOW_ROTATE_180|SHADOW_ROTATE_270)
|
---|
73 | #define SHADOW_REFLECT_X 16
|
---|
74 | #define SHADOW_REFLECT_Y 32
|
---|
75 | #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
|
---|
76 |
|
---|
77 | extern _X_EXPORT DevPrivateKey shadowScrPrivateKey;
|
---|
78 |
|
---|
79 | #define shadowGetBuf(pScr) ((shadowBufPtr) \
|
---|
80 | dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey))
|
---|
81 | #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
|
---|
82 | #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
|
---|
83 |
|
---|
84 | extern _X_EXPORT Bool
|
---|
85 | shadowSetup (ScreenPtr pScreen);
|
---|
86 |
|
---|
87 | extern _X_EXPORT Bool
|
---|
88 | shadowAdd (ScreenPtr pScreen,
|
---|
89 | PixmapPtr pPixmap,
|
---|
90 | ShadowUpdateProc update,
|
---|
91 | ShadowWindowProc window,
|
---|
92 | int randr,
|
---|
93 | void *closure);
|
---|
94 |
|
---|
95 | extern _X_EXPORT void
|
---|
96 | shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
|
---|
97 |
|
---|
98 | extern _X_EXPORT Bool
|
---|
99 | shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
|
---|
100 |
|
---|
101 | extern _X_EXPORT void *
|
---|
102 | shadowAlloc (int width, int height, int bpp);
|
---|
103 |
|
---|
104 | extern _X_EXPORT void
|
---|
105 | shadowUpdatePacked (ScreenPtr pScreen,
|
---|
106 | shadowBufPtr pBuf);
|
---|
107 |
|
---|
108 | extern _X_EXPORT void
|
---|
109 | shadowUpdatePlanar4 (ScreenPtr pScreen,
|
---|
110 | shadowBufPtr pBuf);
|
---|
111 |
|
---|
112 | extern _X_EXPORT void
|
---|
113 | shadowUpdatePlanar4x8 (ScreenPtr pScreen,
|
---|
114 | shadowBufPtr pBuf);
|
---|
115 |
|
---|
116 | extern _X_EXPORT void
|
---|
117 | shadowUpdateRotatePacked (ScreenPtr pScreen,
|
---|
118 | shadowBufPtr pBuf);
|
---|
119 |
|
---|
120 | extern _X_EXPORT void
|
---|
121 | shadowUpdateRotate8_90 (ScreenPtr pScreen,
|
---|
122 | shadowBufPtr pBuf);
|
---|
123 |
|
---|
124 | extern _X_EXPORT void
|
---|
125 | shadowUpdateRotate16_90 (ScreenPtr pScreen,
|
---|
126 | shadowBufPtr pBuf);
|
---|
127 |
|
---|
128 | extern _X_EXPORT void
|
---|
129 | shadowUpdateRotate16_90YX (ScreenPtr pScreen,
|
---|
130 | shadowBufPtr pBuf);
|
---|
131 |
|
---|
132 | extern _X_EXPORT void
|
---|
133 | shadowUpdateRotate32_90 (ScreenPtr pScreen,
|
---|
134 | shadowBufPtr pBuf);
|
---|
135 |
|
---|
136 | extern _X_EXPORT void
|
---|
137 | shadowUpdateRotate8_180 (ScreenPtr pScreen,
|
---|
138 | shadowBufPtr pBuf);
|
---|
139 |
|
---|
140 | extern _X_EXPORT void
|
---|
141 | shadowUpdateRotate16_180 (ScreenPtr pScreen,
|
---|
142 | shadowBufPtr pBuf);
|
---|
143 |
|
---|
144 | extern _X_EXPORT void
|
---|
145 | shadowUpdateRotate32_180 (ScreenPtr pScreen,
|
---|
146 | shadowBufPtr pBuf);
|
---|
147 |
|
---|
148 | extern _X_EXPORT void
|
---|
149 | shadowUpdateRotate8_270 (ScreenPtr pScreen,
|
---|
150 | shadowBufPtr pBuf);
|
---|
151 |
|
---|
152 | extern _X_EXPORT void
|
---|
153 | shadowUpdateRotate16_270 (ScreenPtr pScreen,
|
---|
154 | shadowBufPtr pBuf);
|
---|
155 |
|
---|
156 | extern _X_EXPORT void
|
---|
157 | shadowUpdateRotate16_270YX (ScreenPtr pScreen,
|
---|
158 | shadowBufPtr pBuf);
|
---|
159 |
|
---|
160 | extern _X_EXPORT void
|
---|
161 | shadowUpdateRotate32_270 (ScreenPtr pScreen,
|
---|
162 | shadowBufPtr pBuf);
|
---|
163 |
|
---|
164 | extern _X_EXPORT void
|
---|
165 | shadowUpdateRotate8 (ScreenPtr pScreen,
|
---|
166 | shadowBufPtr pBuf);
|
---|
167 |
|
---|
168 | extern _X_EXPORT void
|
---|
169 | shadowUpdateRotate16 (ScreenPtr pScreen,
|
---|
170 | shadowBufPtr pBuf);
|
---|
171 |
|
---|
172 | extern _X_EXPORT void
|
---|
173 | shadowUpdateRotate32 (ScreenPtr pScreen,
|
---|
174 | shadowBufPtr pBuf);
|
---|
175 |
|
---|
176 | typedef void (* shadowUpdateProc)(ScreenPtr, shadowBufPtr);
|
---|
177 |
|
---|
178 | extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);
|
---|
179 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void);
|
---|
180 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
|
---|
181 | extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void);
|
---|
182 |
|
---|
183 | #endif /* _SHADOW_H_ */
|
---|