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 | #include "picturestr.h"
|
---|
30 |
|
---|
31 | #include "damage.h"
|
---|
32 | #include "damagestr.h"
|
---|
33 | typedef struct _shadowBuf *shadowBufPtr;
|
---|
34 |
|
---|
35 | typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
|
---|
36 | shadowBufPtr pBuf);
|
---|
37 |
|
---|
38 | #define SHADOW_WINDOW_RELOCATE 1
|
---|
39 | #define SHADOW_WINDOW_READ 2
|
---|
40 | #define SHADOW_WINDOW_WRITE 4
|
---|
41 |
|
---|
42 | typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
|
---|
43 | CARD32 row,
|
---|
44 | CARD32 offset,
|
---|
45 | int mode,
|
---|
46 | CARD32 *size,
|
---|
47 | void *closure);
|
---|
48 |
|
---|
49 | /* BC hack: do not move the damage member. see shadow.c for explanation. */
|
---|
50 | typedef struct _shadowBuf {
|
---|
51 | DamagePtr pDamage;
|
---|
52 | ShadowUpdateProc update;
|
---|
53 | ShadowWindowProc window;
|
---|
54 | RegionRec damage;
|
---|
55 | PixmapPtr pPixmap;
|
---|
56 | void *closure;
|
---|
57 | int randr;
|
---|
58 |
|
---|
59 | /* screen wrappers */
|
---|
60 | GetImageProcPtr GetImage;
|
---|
61 | CloseScreenProcPtr CloseScreen;
|
---|
62 | } shadowBufRec;
|
---|
63 |
|
---|
64 | /* Match defines from randr extension */
|
---|
65 | #define SHADOW_ROTATE_0 1
|
---|
66 | #define SHADOW_ROTATE_90 2
|
---|
67 | #define SHADOW_ROTATE_180 4
|
---|
68 | #define SHADOW_ROTATE_270 8
|
---|
69 | #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
|
---|
70 | SHADOW_ROTATE_180|SHADOW_ROTATE_270)
|
---|
71 | #define SHADOW_REFLECT_X 16
|
---|
72 | #define SHADOW_REFLECT_Y 32
|
---|
73 | #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
|
---|
74 |
|
---|
75 | extern _X_EXPORT DevPrivateKey shadowScrPrivateKey;
|
---|
76 |
|
---|
77 | #define shadowGetBuf(pScr) ((shadowBufPtr) \
|
---|
78 | dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey))
|
---|
79 | #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
|
---|
80 | #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
|
---|
81 |
|
---|
82 | extern _X_EXPORT Bool
|
---|
83 | shadowSetup (ScreenPtr pScreen);
|
---|
84 |
|
---|
85 | extern _X_EXPORT Bool
|
---|
86 | shadowAdd (ScreenPtr pScreen,
|
---|
87 | PixmapPtr pPixmap,
|
---|
88 | ShadowUpdateProc update,
|
---|
89 | ShadowWindowProc window,
|
---|
90 | int randr,
|
---|
91 | void *closure);
|
---|
92 |
|
---|
93 | extern _X_EXPORT void
|
---|
94 | shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
|
---|
95 |
|
---|
96 | extern _X_EXPORT Bool
|
---|
97 | shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
|
---|
98 |
|
---|
99 | extern _X_EXPORT void *
|
---|
100 | shadowAlloc (int width, int height, int bpp);
|
---|
101 |
|
---|
102 | extern _X_EXPORT void
|
---|
103 | shadowUpdatePacked (ScreenPtr pScreen,
|
---|
104 | shadowBufPtr pBuf);
|
---|
105 |
|
---|
106 | extern _X_EXPORT void
|
---|
107 | shadowUpdatePlanar4 (ScreenPtr pScreen,
|
---|
108 | shadowBufPtr pBuf);
|
---|
109 |
|
---|
110 | extern _X_EXPORT void
|
---|
111 | shadowUpdatePlanar4x8 (ScreenPtr pScreen,
|
---|
112 | shadowBufPtr pBuf);
|
---|
113 |
|
---|
114 | extern _X_EXPORT void
|
---|
115 | shadowUpdateRotatePacked (ScreenPtr pScreen,
|
---|
116 | shadowBufPtr pBuf);
|
---|
117 |
|
---|
118 | extern _X_EXPORT void
|
---|
119 | shadowUpdateRotate8_90 (ScreenPtr pScreen,
|
---|
120 | shadowBufPtr pBuf);
|
---|
121 |
|
---|
122 | extern _X_EXPORT void
|
---|
123 | shadowUpdateRotate16_90 (ScreenPtr pScreen,
|
---|
124 | shadowBufPtr pBuf);
|
---|
125 |
|
---|
126 | extern _X_EXPORT void
|
---|
127 | shadowUpdateRotate16_90YX (ScreenPtr pScreen,
|
---|
128 | shadowBufPtr pBuf);
|
---|
129 |
|
---|
130 | extern _X_EXPORT void
|
---|
131 | shadowUpdateRotate32_90 (ScreenPtr pScreen,
|
---|
132 | shadowBufPtr pBuf);
|
---|
133 |
|
---|
134 | extern _X_EXPORT void
|
---|
135 | shadowUpdateRotate8_180 (ScreenPtr pScreen,
|
---|
136 | shadowBufPtr pBuf);
|
---|
137 |
|
---|
138 | extern _X_EXPORT void
|
---|
139 | shadowUpdateRotate16_180 (ScreenPtr pScreen,
|
---|
140 | shadowBufPtr pBuf);
|
---|
141 |
|
---|
142 | extern _X_EXPORT void
|
---|
143 | shadowUpdateRotate32_180 (ScreenPtr pScreen,
|
---|
144 | shadowBufPtr pBuf);
|
---|
145 |
|
---|
146 | extern _X_EXPORT void
|
---|
147 | shadowUpdateRotate8_270 (ScreenPtr pScreen,
|
---|
148 | shadowBufPtr pBuf);
|
---|
149 |
|
---|
150 | extern _X_EXPORT void
|
---|
151 | shadowUpdateRotate16_270 (ScreenPtr pScreen,
|
---|
152 | shadowBufPtr pBuf);
|
---|
153 |
|
---|
154 | extern _X_EXPORT void
|
---|
155 | shadowUpdateRotate16_270YX (ScreenPtr pScreen,
|
---|
156 | shadowBufPtr pBuf);
|
---|
157 |
|
---|
158 | extern _X_EXPORT void
|
---|
159 | shadowUpdateRotate32_270 (ScreenPtr pScreen,
|
---|
160 | shadowBufPtr pBuf);
|
---|
161 |
|
---|
162 | extern _X_EXPORT void
|
---|
163 | shadowUpdateRotate8 (ScreenPtr pScreen,
|
---|
164 | shadowBufPtr pBuf);
|
---|
165 |
|
---|
166 | extern _X_EXPORT void
|
---|
167 | shadowUpdateRotate16 (ScreenPtr pScreen,
|
---|
168 | shadowBufPtr pBuf);
|
---|
169 |
|
---|
170 | extern _X_EXPORT void
|
---|
171 | shadowUpdateRotate32 (ScreenPtr pScreen,
|
---|
172 | shadowBufPtr pBuf);
|
---|
173 |
|
---|
174 | typedef void (* shadowUpdateProc)(ScreenPtr, shadowBufPtr);
|
---|
175 |
|
---|
176 | extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);
|
---|
177 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void);
|
---|
178 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
|
---|
179 | extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void);
|
---|
180 |
|
---|
181 | #endif /* _SHADOW_H_ */
|
---|