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