1 | /*
|
---|
2 | * $Id: compint.h,v 1.7 2005/07/03 07:01:17 daniels Exp $
|
---|
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 | #if COMP_INCLUDE_RGB24_VISUAL
|
---|
113 | #define NUM_COMP_ALTERNATE_VISUALS 2
|
---|
114 | #else
|
---|
115 | #define NUM_COMP_ALTERNATE_VISUALS 1
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
|
---|
119 |
|
---|
120 | typedef struct _CompOverlayClientRec {
|
---|
121 | CompOverlayClientPtr pNext;
|
---|
122 | ClientPtr pClient;
|
---|
123 | ScreenPtr pScreen;
|
---|
124 | XID resource;
|
---|
125 | } CompOverlayClientRec;
|
---|
126 |
|
---|
127 | typedef struct _CompScreen {
|
---|
128 | PositionWindowProcPtr PositionWindow;
|
---|
129 | CopyWindowProcPtr CopyWindow;
|
---|
130 | CreateWindowProcPtr CreateWindow;
|
---|
131 | DestroyWindowProcPtr DestroyWindow;
|
---|
132 | RealizeWindowProcPtr RealizeWindow;
|
---|
133 | UnrealizeWindowProcPtr UnrealizeWindow;
|
---|
134 | PaintWindowProcPtr PaintWindowBackground;
|
---|
135 | ClipNotifyProcPtr ClipNotify;
|
---|
136 | /*
|
---|
137 | * Called from ConfigureWindow, these
|
---|
138 | * three track changes to the offscreen storage
|
---|
139 | * geometry
|
---|
140 | */
|
---|
141 | MoveWindowProcPtr MoveWindow;
|
---|
142 | ResizeWindowProcPtr ResizeWindow;
|
---|
143 | ChangeBorderWidthProcPtr ChangeBorderWidth;
|
---|
144 | /*
|
---|
145 | * Reparenting has an effect on Subwindows redirect
|
---|
146 | */
|
---|
147 | ReparentWindowProcPtr ReparentWindow;
|
---|
148 |
|
---|
149 | /*
|
---|
150 | * Colormaps for new visuals better not get installed
|
---|
151 | */
|
---|
152 | InstallColormapProcPtr InstallColormap;
|
---|
153 |
|
---|
154 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
155 | CloseScreenProcPtr CloseScreen;
|
---|
156 | Bool damaged;
|
---|
157 | XID alternateVisuals[NUM_COMP_ALTERNATE_VISUALS];
|
---|
158 |
|
---|
159 | WindowPtr pOverlayWin;
|
---|
160 | CompOverlayClientPtr pOverlayClients;
|
---|
161 |
|
---|
162 | } CompScreenRec, *CompScreenPtr;
|
---|
163 |
|
---|
164 | extern int CompScreenPrivateIndex;
|
---|
165 | extern int CompWindowPrivateIndex;
|
---|
166 | extern int CompSubwindowsPrivateIndex;
|
---|
167 |
|
---|
168 | #define GetCompScreen(s) ((CompScreenPtr) ((s)->devPrivates[CompScreenPrivateIndex].ptr))
|
---|
169 | #define GetCompWindow(w) ((CompWindowPtr) ((w)->devPrivates[CompWindowPrivateIndex].ptr))
|
---|
170 | #define GetCompSubwindows(w) ((CompSubwindowsPtr) ((w)->devPrivates[CompSubwindowsPrivateIndex].ptr))
|
---|
171 |
|
---|
172 | extern RESTYPE CompositeClientWindowType;
|
---|
173 | extern RESTYPE CompositeClientSubwindowsType;
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * compalloc.c
|
---|
177 | */
|
---|
178 |
|
---|
179 | void
|
---|
180 | compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
|
---|
181 |
|
---|
182 | Bool
|
---|
183 | compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
184 |
|
---|
185 | void
|
---|
186 | compFreeClientWindow (WindowPtr pWin, XID id);
|
---|
187 |
|
---|
188 | int
|
---|
189 | compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
190 |
|
---|
191 | int
|
---|
192 | compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
193 |
|
---|
194 | void
|
---|
195 | compFreeClientSubwindows (WindowPtr pWin, XID id);
|
---|
196 |
|
---|
197 | int
|
---|
198 | compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
199 |
|
---|
200 | int
|
---|
201 | compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
202 |
|
---|
203 | int
|
---|
204 | compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
205 |
|
---|
206 | Bool
|
---|
207 | compAllocPixmap (WindowPtr pWin);
|
---|
208 |
|
---|
209 | void
|
---|
210 | compFreePixmap (WindowPtr pWin);
|
---|
211 |
|
---|
212 | Bool
|
---|
213 | compReallocPixmap (WindowPtr pWin, int x, int y,
|
---|
214 | unsigned int w, unsigned int h, int bw);
|
---|
215 |
|
---|
216 | /*
|
---|
217 | * compext.c
|
---|
218 | */
|
---|
219 |
|
---|
220 | void
|
---|
221 | CompositeExtensionInit (void);
|
---|
222 |
|
---|
223 | /*
|
---|
224 | * compinit.c
|
---|
225 | */
|
---|
226 |
|
---|
227 | Bool
|
---|
228 | compScreenInit (ScreenPtr pScreen);
|
---|
229 |
|
---|
230 | /*
|
---|
231 | * compwindow.c
|
---|
232 | */
|
---|
233 |
|
---|
234 | #ifdef COMPOSITE_DEBUG
|
---|
235 | void
|
---|
236 | compCheckTree (ScreenPtr pScreen);
|
---|
237 | #else
|
---|
238 | #define compCheckTree(s)
|
---|
239 | #endif
|
---|
240 |
|
---|
241 | void
|
---|
242 | compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
---|
243 |
|
---|
244 | Bool
|
---|
245 | compCheckRedirect (WindowPtr pWin);
|
---|
246 |
|
---|
247 | Bool
|
---|
248 | compPositionWindow (WindowPtr pWin, int x, int y);
|
---|
249 |
|
---|
250 | Bool
|
---|
251 | compRealizeWindow (WindowPtr pWin);
|
---|
252 |
|
---|
253 | Bool
|
---|
254 | compUnrealizeWindow (WindowPtr pWin);
|
---|
255 |
|
---|
256 | void
|
---|
257 | compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
|
---|
258 |
|
---|
259 | void
|
---|
260 | compClipNotify (WindowPtr pWin, int dx, int dy);
|
---|
261 |
|
---|
262 | void
|
---|
263 | compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
|
---|
264 |
|
---|
265 | void
|
---|
266 | compResizeWindow (WindowPtr pWin, int x, int y,
|
---|
267 | unsigned int w, unsigned int h, WindowPtr pSib);
|
---|
268 |
|
---|
269 | void
|
---|
270 | compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
|
---|
271 |
|
---|
272 | void
|
---|
273 | compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
|
---|
274 |
|
---|
275 | Bool
|
---|
276 | compCreateWindow (WindowPtr pWin);
|
---|
277 |
|
---|
278 | Bool
|
---|
279 | compDestroyWindow (WindowPtr pWin);
|
---|
280 |
|
---|
281 | void
|
---|
282 | compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
|
---|
283 |
|
---|
284 | RegionPtr
|
---|
285 | compGetRedirectBorderClip (WindowPtr pWin);
|
---|
286 |
|
---|
287 | void
|
---|
288 | compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
---|
289 |
|
---|
290 | void
|
---|
291 | compWindowUpdate (WindowPtr pWin);
|
---|
292 |
|
---|
293 | void
|
---|
294 | deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
|
---|
295 |
|
---|
296 | int
|
---|
297 | ProcCompositeGetOverlayWindow (ClientPtr client);
|
---|
298 |
|
---|
299 | int
|
---|
300 | ProcCompositeReleaseOverlayWindow (ClientPtr client);
|
---|
301 |
|
---|
302 | int
|
---|
303 | SProcCompositeGetOverlayWindow (ClientPtr client);
|
---|
304 |
|
---|
305 | int
|
---|
306 | SProcCompositeReleaseOverlayWindow (ClientPtr client);
|
---|
307 |
|
---|
308 | WindowPtr
|
---|
309 | CompositeRealChildHead (WindowPtr pWin);
|
---|
310 |
|
---|
311 | int
|
---|
312 | DeleteWindowNoInputDevices(pointer value, XID wid);
|
---|
313 |
|
---|
314 | #endif /* _COMPINT_H_ */
|
---|