1 | /*
|
---|
2 | * $XFree86: xc/programs/Xserver/miext/shadow/shadow.h,v 1.6tsi Exp $
|
---|
3 | *
|
---|
4 | * Copyright © 2000 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 | #ifndef _SHADOW_H_
|
---|
26 | #define _SHADOW_H_
|
---|
27 |
|
---|
28 | #include "scrnintstr.h"
|
---|
29 |
|
---|
30 | #ifdef RENDER
|
---|
31 | #include "picturestr.h"
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | typedef struct _shadowBuf *shadowBufPtr;
|
---|
35 |
|
---|
36 | typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
|
---|
37 | shadowBufPtr pBuf);
|
---|
38 |
|
---|
39 | #define SHADOW_WINDOW_RELOCATE 1
|
---|
40 | #define SHADOW_WINDOW_READ 2
|
---|
41 | #define SHADOW_WINDOW_WRITE 4
|
---|
42 |
|
---|
43 | typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
|
---|
44 | CARD32 row,
|
---|
45 | CARD32 offset,
|
---|
46 | int mode,
|
---|
47 | CARD32 *size,
|
---|
48 | void *closure);
|
---|
49 |
|
---|
50 | typedef struct _shadowBuf {
|
---|
51 | shadowBufPtr pNext;
|
---|
52 | ShadowUpdateProc update;
|
---|
53 | ShadowWindowProc window;
|
---|
54 | RegionRec damage;
|
---|
55 | PixmapPtr pPixmap;
|
---|
56 | void *closure;
|
---|
57 | int randr;
|
---|
58 | } shadowBufRec;
|
---|
59 |
|
---|
60 | /* Match defines from randr extension */
|
---|
61 | #define SHADOW_ROTATE_0 1
|
---|
62 | #define SHADOW_ROTATE_90 2
|
---|
63 | #define SHADOW_ROTATE_180 4
|
---|
64 | #define SHADOW_ROTATE_270 8
|
---|
65 | #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
|
---|
66 | SHADOW_ROTATE_180|SHADOW_ROTATE_270)
|
---|
67 | #define SHADOW_REFLECT_X 16
|
---|
68 | #define SHADOW_REFLECT_Y 32
|
---|
69 | #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
|
---|
70 |
|
---|
71 | typedef struct _shadowScrPriv {
|
---|
72 | PaintWindowBackgroundProcPtr PaintWindowBackground;
|
---|
73 | PaintWindowBorderProcPtr PaintWindowBorder;
|
---|
74 | CopyWindowProcPtr CopyWindow;
|
---|
75 | CloseScreenProcPtr CloseScreen;
|
---|
76 | CreateGCProcPtr CreateGC;
|
---|
77 | GetImageProcPtr GetImage;
|
---|
78 | #ifdef RENDER
|
---|
79 | CompositeProcPtr Composite;
|
---|
80 | GlyphsProcPtr Glyphs;
|
---|
81 | #endif
|
---|
82 | shadowBufPtr pBuf;
|
---|
83 | BSFuncRec BackingStoreFuncs;
|
---|
84 | } shadowScrPrivRec, *shadowScrPrivPtr;
|
---|
85 |
|
---|
86 | extern int shadowScrPrivateIndex;
|
---|
87 |
|
---|
88 | #define shadowGetScrPriv(pScr) ((shadowScrPrivPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr)
|
---|
89 | #define shadowScrPriv(pScr) shadowScrPrivPtr pScrPriv = shadowGetScrPriv(pScr)
|
---|
90 |
|
---|
91 | Bool
|
---|
92 | shadowSetup (ScreenPtr pScreen);
|
---|
93 |
|
---|
94 | Bool
|
---|
95 | shadowAdd (ScreenPtr pScreen,
|
---|
96 | PixmapPtr pPixmap,
|
---|
97 | ShadowUpdateProc update,
|
---|
98 | ShadowWindowProc window,
|
---|
99 | int randr,
|
---|
100 | void *closure);
|
---|
101 |
|
---|
102 | void
|
---|
103 | shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
|
---|
104 |
|
---|
105 | shadowBufPtr
|
---|
106 | shadowFindBuf (WindowPtr pWindow);
|
---|
107 |
|
---|
108 | Bool
|
---|
109 | shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
|
---|
110 |
|
---|
111 | void *
|
---|
112 | shadowAlloc (int width, int height, int bpp);
|
---|
113 |
|
---|
114 | void
|
---|
115 | shadowUpdatePacked (ScreenPtr pScreen,
|
---|
116 | shadowBufPtr pBuf);
|
---|
117 |
|
---|
118 | void
|
---|
119 | shadowUpdatePlanar4 (ScreenPtr pScreen,
|
---|
120 | shadowBufPtr pBuf);
|
---|
121 |
|
---|
122 | void
|
---|
123 | shadowUpdatePlanar4x8 (ScreenPtr pScreen,
|
---|
124 | shadowBufPtr pBuf);
|
---|
125 |
|
---|
126 | void
|
---|
127 | shadowUpdateRotatePacked (ScreenPtr pScreen,
|
---|
128 | shadowBufPtr pBuf);
|
---|
129 |
|
---|
130 | void
|
---|
131 | shadowUpdateRotate8_90 (ScreenPtr pScreen,
|
---|
132 | shadowBufPtr pBuf);
|
---|
133 |
|
---|
134 | void
|
---|
135 | shadowUpdateRotate16_90 (ScreenPtr pScreen,
|
---|
136 | shadowBufPtr pBuf);
|
---|
137 |
|
---|
138 | void
|
---|
139 | shadowUpdateRotate32_90 (ScreenPtr pScreen,
|
---|
140 | shadowBufPtr pBuf);
|
---|
141 |
|
---|
142 | void
|
---|
143 | shadowUpdateRotate8_180 (ScreenPtr pScreen,
|
---|
144 | shadowBufPtr pBuf);
|
---|
145 |
|
---|
146 | void
|
---|
147 | shadowUpdateRotate16_180 (ScreenPtr pScreen,
|
---|
148 | shadowBufPtr pBuf);
|
---|
149 |
|
---|
150 | void
|
---|
151 | shadowUpdateRotate32_180 (ScreenPtr pScreen,
|
---|
152 | shadowBufPtr pBuf);
|
---|
153 |
|
---|
154 | void
|
---|
155 | shadowUpdateRotate8_270 (ScreenPtr pScreen,
|
---|
156 | shadowBufPtr pBuf);
|
---|
157 |
|
---|
158 | void
|
---|
159 | shadowUpdateRotate16_270 (ScreenPtr pScreen,
|
---|
160 | shadowBufPtr pBuf);
|
---|
161 |
|
---|
162 | void
|
---|
163 | shadowUpdateRotate32_270 (ScreenPtr pScreen,
|
---|
164 | shadowBufPtr pBuf);
|
---|
165 |
|
---|
166 | typedef void (* shadowUpdateProc)(ScreenPtr, shadowBufPtr);
|
---|
167 |
|
---|
168 | shadowUpdateProc shadowUpdatePackedWeak(void);
|
---|
169 | shadowUpdateProc shadowUpdatePlanar4Weak(void);
|
---|
170 | shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
|
---|
171 | shadowUpdateProc shadowUpdateRotatePackedWeak(void);
|
---|
172 |
|
---|
173 | void
|
---|
174 | shadowWrapGC (GCPtr pGC);
|
---|
175 |
|
---|
176 | void
|
---|
177 | shadowUnwrapGC (GCPtr pGC);
|
---|
178 |
|
---|
179 | #endif /* _SHADOW_H_ */
|
---|