1 | /*
|
---|
2 | * $Id$
|
---|
3 | *
|
---|
4 | * Copyright © 2006 Sun Microsystems
|
---|
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 Sun Microsystems not be used in
|
---|
11 | * advertising or publicity pertaining to distribution of the software without
|
---|
12 | * specific, written prior permission. Sun Microsystems 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 | * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
18 | * EVENT SHALL SUN MICROSYSTEMS 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 | * Copyright © 2003 Keith Packard
|
---|
25 | *
|
---|
26 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
27 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
28 | * the above copyright notice appear in all copies and that both that
|
---|
29 | * copyright notice and this permission notice appear in supporting
|
---|
30 | * documentation, and that the name of Keith Packard not be used in
|
---|
31 | * advertising or publicity pertaining to distribution of the software without
|
---|
32 | * specific, written prior permission. Keith Packard makes no
|
---|
33 | * representations about the suitability of this software for any purpose. It
|
---|
34 | * is provided "as is" without express or implied warranty.
|
---|
35 | *
|
---|
36 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
37 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
38 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
39 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
40 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
41 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
42 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
43 | */
|
---|
44 |
|
---|
45 | #ifdef HAVE_DIX_CONFIG_H
|
---|
46 | #include <dix-config.h>
|
---|
47 | #endif
|
---|
48 |
|
---|
49 | #ifndef _COMPINT_H_
|
---|
50 | #define _COMPINT_H_
|
---|
51 |
|
---|
52 | #include "misc.h"
|
---|
53 | #include "scrnintstr.h"
|
---|
54 | #include "os.h"
|
---|
55 | #include "regionstr.h"
|
---|
56 | #include "validate.h"
|
---|
57 | #include "windowstr.h"
|
---|
58 | #include "input.h"
|
---|
59 | #include "resource.h"
|
---|
60 | #include "colormapst.h"
|
---|
61 | #include "cursorstr.h"
|
---|
62 | #include "dixstruct.h"
|
---|
63 | #include "gcstruct.h"
|
---|
64 | #include "servermd.h"
|
---|
65 | #include "dixevents.h"
|
---|
66 | #include "globals.h"
|
---|
67 | #include "picturestr.h"
|
---|
68 | #include "extnsionst.h"
|
---|
69 | #include "mi.h"
|
---|
70 | #include "damage.h"
|
---|
71 | #include "damageextint.h"
|
---|
72 | #include "xfixes.h"
|
---|
73 | #include <X11/extensions/compositeproto.h>
|
---|
74 | #include <assert.h>
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * enable this for debugging
|
---|
78 |
|
---|
79 | #define COMPOSITE_DEBUG
|
---|
80 | */
|
---|
81 |
|
---|
82 | typedef struct _CompClientWindow {
|
---|
83 | struct _CompClientWindow *next;
|
---|
84 | XID id;
|
---|
85 | int update;
|
---|
86 | } CompClientWindowRec, *CompClientWindowPtr;
|
---|
87 |
|
---|
88 | typedef struct _CompWindow {
|
---|
89 | RegionRec borderClip;
|
---|
90 | DamagePtr damage; /* for automatic update mode */
|
---|
91 | Bool damageRegistered;
|
---|
92 | Bool damaged;
|
---|
93 | int update;
|
---|
94 | CompClientWindowPtr clients;
|
---|
95 | int oldx;
|
---|
96 | int oldy;
|
---|
97 | PixmapPtr pOldPixmap;
|
---|
98 | int borderClipX, borderClipY;
|
---|
99 | } CompWindowRec, *CompWindowPtr;
|
---|
100 |
|
---|
101 | #define COMP_ORIGIN_INVALID 0x80000000
|
---|
102 |
|
---|
103 | typedef struct _CompSubwindows {
|
---|
104 | int update;
|
---|
105 | CompClientWindowPtr clients;
|
---|
106 | } CompSubwindowsRec, *CompSubwindowsPtr;
|
---|
107 |
|
---|
108 | #ifndef COMP_INCLUDE_RGB24_VISUAL
|
---|
109 | #define COMP_INCLUDE_RGB24_VISUAL 0
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
|
---|
113 |
|
---|
114 | typedef struct _CompOverlayClientRec {
|
---|
115 | CompOverlayClientPtr pNext;
|
---|
116 | ClientPtr pClient;
|
---|
117 | ScreenPtr pScreen;
|
---|
118 | XID resource;
|
---|
119 | } CompOverlayClientRec;
|
---|
120 |
|
---|
121 | typedef struct _CompScreen {
|
---|
122 | PositionWindowProcPtr PositionWindow;
|
---|
123 | CopyWindowProcPtr CopyWindow;
|
---|
124 | CreateWindowProcPtr CreateWindow;
|
---|
125 | DestroyWindowProcPtr DestroyWindow;
|
---|
126 | RealizeWindowProcPtr RealizeWindow;
|
---|
127 | UnrealizeWindowProcPtr UnrealizeWindow;
|
---|
128 | PaintWindowProcPtr PaintWindowBackground;
|
---|
129 | ClipNotifyProcPtr ClipNotify;
|
---|
130 | /*
|
---|
131 | * Called from ConfigureWindow, these
|
---|
132 | * three track changes to the offscreen storage
|
---|
133 | * geometry
|
---|
134 | */
|
---|
135 | MoveWindowProcPtr MoveWindow;
|
---|
136 | ResizeWindowProcPtr ResizeWindow;
|
---|
137 | ChangeBorderWidthProcPtr ChangeBorderWidth;
|
---|
138 | /*
|
---|
139 | * Reparenting has an effect on Subwindows redirect
|
---|
140 | */
|
---|
141 | ReparentWindowProcPtr ReparentWindow;
|
---|
142 |
|
---|
143 | /*
|
---|
144 | * Colormaps for new visuals better not get installed
|
---|
145 | */
|
---|
146 | InstallColormapProcPtr InstallColormap;
|
---|
147 |
|
---|
148 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
149 | CloseScreenProcPtr CloseScreen;
|
---|
150 | Bool damaged;
|
---|
151 | int numAlternateVisuals;
|
---|
152 | VisualID *alternateVisuals;
|
---|
153 |
|
---|
154 | WindowPtr pOverlayWin;
|
---|
155 | CompOverlayClientPtr pOverlayClients;
|
---|
156 |
|
---|
157 | } CompScreenRec, *CompScreenPtr;
|
---|
158 |
|
---|
159 | extern int CompScreenPrivateIndex;
|
---|
160 | extern int CompWindowPrivateIndex;
|
---|
161 | extern int CompSubwindowsPrivateIndex;
|
---|
162 |
|
---|
163 | #define GetCompScreen(s) ((CompScreenPtr) ((s)->devPrivates[CompScreenPrivateIndex].ptr))
|
---|
164 | #define GetCompWindow(w) ((CompWindowPtr) ((w)->devPrivates[CompWindowPrivateIndex].ptr))
|
---|
165 | #define GetCompSubwindows(w) ((CompSubwindowsPtr) ((w)->devPrivates[CompSubwindowsPrivateIndex].ptr))
|
---|
166 |
|
---|
167 | extern RESTYPE CompositeClientWindowType;
|
---|
168 | extern RESTYPE CompositeClientSubwindowsType;
|
---|
169 |
|
---|
170 | /*
|
---|
171 | * compalloc.c
|
---|
172 | */
|
---|
173 |
|
---|
174 | void
|
---|
175 | compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
|
---|
176 |
|
---|
177 | Bool
|
---|
178 | compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
179 |
|
---|
180 | void
|
---|
181 | compFreeClientWindow (WindowPtr pWin, XID id);
|
---|
182 |
|
---|
183 | int
|
---|
184 | compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
185 |
|
---|
186 | int
|
---|
187 | compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
188 |
|
---|
189 | void
|
---|
190 | compFreeClientSubwindows (WindowPtr pWin, XID id);
|
---|
191 |
|
---|
192 | int
|
---|
193 | compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
194 |
|
---|
195 | int
|
---|
196 | compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
197 |
|
---|
198 | int
|
---|
199 | compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
200 |
|
---|
201 | Bool
|
---|
202 | compAllocPixmap (WindowPtr pWin);
|
---|
203 |
|
---|
204 | void
|
---|
205 | compFreePixmap (WindowPtr pWin);
|
---|
206 |
|
---|
207 | Bool
|
---|
208 | compReallocPixmap (WindowPtr pWin, int x, int y,
|
---|
209 | unsigned int w, unsigned int h, int bw);
|
---|
210 |
|
---|
211 | /*
|
---|
212 | * compext.c
|
---|
213 | */
|
---|
214 |
|
---|
215 | void
|
---|
216 | CompositeExtensionInit (void);
|
---|
217 |
|
---|
218 | /*
|
---|
219 | * compinit.c
|
---|
220 | */
|
---|
221 |
|
---|
222 | Bool
|
---|
223 | CompositeRegisterAlternateVisuals (ScreenPtr pScreen,
|
---|
224 | VisualID *vids, int nVisuals);
|
---|
225 |
|
---|
226 | Bool
|
---|
227 | compScreenInit (ScreenPtr pScreen);
|
---|
228 |
|
---|
229 | /*
|
---|
230 | * compwindow.c
|
---|
231 | */
|
---|
232 |
|
---|
233 | #ifdef COMPOSITE_DEBUG
|
---|
234 | void
|
---|
235 | compCheckTree (ScreenPtr pScreen);
|
---|
236 | #else
|
---|
237 | #define compCheckTree(s)
|
---|
238 | #endif
|
---|
239 |
|
---|
240 | void
|
---|
241 | compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
---|
242 |
|
---|
243 | Bool
|
---|
244 | compCheckRedirect (WindowPtr pWin);
|
---|
245 |
|
---|
246 | Bool
|
---|
247 | compPositionWindow (WindowPtr pWin, int x, int y);
|
---|
248 |
|
---|
249 | Bool
|
---|
250 | compRealizeWindow (WindowPtr pWin);
|
---|
251 |
|
---|
252 | Bool
|
---|
253 | compUnrealizeWindow (WindowPtr pWin);
|
---|
254 |
|
---|
255 | void
|
---|
256 | compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
|
---|
257 |
|
---|
258 | void
|
---|
259 | compClipNotify (WindowPtr pWin, int dx, int dy);
|
---|
260 |
|
---|
261 | void
|
---|
262 | compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
|
---|
263 |
|
---|
264 | void
|
---|
265 | compResizeWindow (WindowPtr pWin, int x, int y,
|
---|
266 | unsigned int w, unsigned int h, WindowPtr pSib);
|
---|
267 |
|
---|
268 | void
|
---|
269 | compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
|
---|
270 |
|
---|
271 | void
|
---|
272 | compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
|
---|
273 |
|
---|
274 | Bool
|
---|
275 | compCreateWindow (WindowPtr pWin);
|
---|
276 |
|
---|
277 | Bool
|
---|
278 | compDestroyWindow (WindowPtr pWin);
|
---|
279 |
|
---|
280 | void
|
---|
281 | compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
|
---|
282 |
|
---|
283 | RegionPtr
|
---|
284 | compGetRedirectBorderClip (WindowPtr pWin);
|
---|
285 |
|
---|
286 | void
|
---|
287 | compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
---|
288 |
|
---|
289 | void
|
---|
290 | compWindowUpdate (WindowPtr pWin);
|
---|
291 |
|
---|
292 | void
|
---|
293 | deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
|
---|
294 |
|
---|
295 | int
|
---|
296 | ProcCompositeGetOverlayWindow (ClientPtr client);
|
---|
297 |
|
---|
298 | int
|
---|
299 | ProcCompositeReleaseOverlayWindow (ClientPtr client);
|
---|
300 |
|
---|
301 | int
|
---|
302 | SProcCompositeGetOverlayWindow (ClientPtr client);
|
---|
303 |
|
---|
304 | int
|
---|
305 | SProcCompositeReleaseOverlayWindow (ClientPtr client);
|
---|
306 |
|
---|
307 | WindowPtr
|
---|
308 | CompositeRealChildHead (WindowPtr pWin);
|
---|
309 |
|
---|
310 | int
|
---|
311 | DeleteWindowNoInputDevices(pointer value, XID wid);
|
---|
312 |
|
---|
313 | #endif /* _COMPINT_H_ */
|
---|