2
* Copyright © 2006 Sun Microsystems
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.
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.
22
* Copyright © 2003 Keith Packard
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.
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.
43
#ifdef HAVE_DIX_CONFIG_H
44
#include <dix-config.h>
51
#include "scrnintstr.h"
53
#include "regionstr.h"
55
#include "windowstr.h"
58
#include "colormapst.h"
59
#include "cursorstr.h"
60
#include "dixstruct.h"
63
#include "dixevents.h"
65
#include "picturestr.h"
66
#include "extnsionst.h"
70
#include "damageextint.h"
72
#include <X11/extensions/compositeproto.h>
76
* enable this for debugging
78
#define COMPOSITE_DEBUG
81
typedef struct _CompClientWindow {
82
struct _CompClientWindow *next;
85
} CompClientWindowRec, *CompClientWindowPtr;
87
typedef struct _CompWindow {
89
DamagePtr damage; /* for automatic update mode */
90
Bool damageRegistered;
93
CompClientWindowPtr clients;
97
int borderClipX, borderClipY;
98
} CompWindowRec, *CompWindowPtr;
100
#define COMP_ORIGIN_INVALID 0x80000000
102
typedef struct _CompSubwindows {
104
CompClientWindowPtr clients;
105
} CompSubwindowsRec, *CompSubwindowsPtr;
107
#ifndef COMP_INCLUDE_RGB24_VISUAL
108
#define COMP_INCLUDE_RGB24_VISUAL 0
111
typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
113
typedef struct _CompOverlayClientRec {
114
CompOverlayClientPtr pNext;
118
} CompOverlayClientRec;
120
typedef struct _CompScreen {
121
PositionWindowProcPtr PositionWindow;
122
CopyWindowProcPtr CopyWindow;
123
CreateWindowProcPtr CreateWindow;
124
DestroyWindowProcPtr DestroyWindow;
125
RealizeWindowProcPtr RealizeWindow;
126
UnrealizeWindowProcPtr UnrealizeWindow;
127
ClipNotifyProcPtr ClipNotify;
129
* Called from ConfigureWindow, these
130
* three track changes to the offscreen storage
133
MoveWindowProcPtr MoveWindow;
134
ResizeWindowProcPtr ResizeWindow;
135
ChangeBorderWidthProcPtr ChangeBorderWidth;
137
* Reparenting has an effect on Subwindows redirect
139
ReparentWindowProcPtr ReparentWindow;
142
* Colormaps for new visuals better not get installed
144
InstallColormapProcPtr InstallColormap;
147
* Fake backing store via automatic redirection
149
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
151
ScreenBlockHandlerProcPtr BlockHandler;
152
CloseScreenProcPtr CloseScreen;
154
int numAlternateVisuals;
155
VisualID *alternateVisuals;
157
WindowPtr pOverlayWin;
158
CompOverlayClientPtr pOverlayClients;
160
} CompScreenRec, *CompScreenPtr;
162
extern DevPrivateKey CompScreenPrivateKey;
163
extern DevPrivateKey CompWindowPrivateKey;
164
extern DevPrivateKey CompSubwindowsPrivateKey;
166
#define GetCompScreen(s) ((CompScreenPtr) \
167
dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey))
168
#define GetCompWindow(w) ((CompWindowPtr) \
169
dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey))
170
#define GetCompSubwindows(w) ((CompSubwindowsPtr) \
171
dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
173
extern RESTYPE CompositeClientWindowType;
174
extern RESTYPE CompositeClientSubwindowsType;
181
compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
184
compFreeClientWindow (WindowPtr pWin, XID id);
187
compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
190
compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
193
compFreeClientSubwindows (WindowPtr pWin, XID id);
196
compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
199
compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
202
compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
205
compAllocPixmap (WindowPtr pWin);
208
compFreePixmap (WindowPtr pWin);
211
compReallocPixmap (WindowPtr pWin, int x, int y,
212
unsigned int w, unsigned int h, int bw);
219
CompositeExtensionInit (void);
226
CompositeRegisterAlternateVisuals (ScreenPtr pScreen,
227
VisualID *vids, int nVisuals);
230
compScreenInit (ScreenPtr pScreen);
236
#ifdef COMPOSITE_DEBUG
238
compCheckTree (ScreenPtr pScreen);
240
#define compCheckTree(s)
244
compWindowFormat (WindowPtr pWin);
247
compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
250
compCheckRedirect (WindowPtr pWin);
253
compPositionWindow (WindowPtr pWin, int x, int y);
256
compRealizeWindow (WindowPtr pWin);
259
compUnrealizeWindow (WindowPtr pWin);
262
compClipNotify (WindowPtr pWin, int dx, int dy);
265
compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
268
compResizeWindow (WindowPtr pWin, int x, int y,
269
unsigned int w, unsigned int h, WindowPtr pSib);
272
compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
275
compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
278
compCreateWindow (WindowPtr pWin);
281
compDestroyWindow (WindowPtr pWin);
284
compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
287
compGetRedirectBorderClip (WindowPtr pWin);
290
compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
293
compWindowUpdate (WindowPtr pWin);
296
deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
299
CompositeRealChildHead (WindowPtr pWin);
302
DeleteWindowNoInputDevices(pointer value, XID wid);
304
#endif /* _COMPINT_H_ */