1 | /*
|
---|
2 | * $Id: compint.h,v 1.8 2005/07/03 08:53:37 daniels Exp $
|
---|
3 | *
|
---|
4 | * Copyright © 2003 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 | #ifdef HAVE_DIX_CONFIG_H
|
---|
26 | #include <dix-config.h>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #ifndef _COMPINT_H_
|
---|
30 | #define _COMPINT_H_
|
---|
31 |
|
---|
32 | #include "misc.h"
|
---|
33 | #include "scrnintstr.h"
|
---|
34 | #include "os.h"
|
---|
35 | #include "regionstr.h"
|
---|
36 | #include "validate.h"
|
---|
37 | #include "windowstr.h"
|
---|
38 | #include "input.h"
|
---|
39 | #include "resource.h"
|
---|
40 | #include "colormapst.h"
|
---|
41 | #include "cursorstr.h"
|
---|
42 | #include "dixstruct.h"
|
---|
43 | #include "gcstruct.h"
|
---|
44 | #include "servermd.h"
|
---|
45 | #include "dixevents.h"
|
---|
46 | #include "globals.h"
|
---|
47 | #include "picturestr.h"
|
---|
48 | #include "extnsionst.h"
|
---|
49 | #include "mi.h"
|
---|
50 | #include "damage.h"
|
---|
51 | #include "damageextint.h"
|
---|
52 | #include "xfixes.h"
|
---|
53 | #include <X11/extensions/compositeproto.h>
|
---|
54 | #include <assert.h>
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * enable this for debugging
|
---|
58 |
|
---|
59 | #define COMPOSITE_DEBUG
|
---|
60 | */
|
---|
61 |
|
---|
62 | typedef struct _CompClientWindow {
|
---|
63 | struct _CompClientWindow *next;
|
---|
64 | XID id;
|
---|
65 | int update;
|
---|
66 | } CompClientWindowRec, *CompClientWindowPtr;
|
---|
67 |
|
---|
68 | typedef struct _CompWindow {
|
---|
69 | RegionRec borderClip;
|
---|
70 | DamagePtr damage; /* for automatic update mode */
|
---|
71 | Bool damageRegistered;
|
---|
72 | Bool damaged;
|
---|
73 | int update;
|
---|
74 | CompClientWindowPtr clients;
|
---|
75 | int oldx;
|
---|
76 | int oldy;
|
---|
77 | PixmapPtr pOldPixmap;
|
---|
78 | int borderClipX, borderClipY;
|
---|
79 | } CompWindowRec, *CompWindowPtr;
|
---|
80 |
|
---|
81 | #define COMP_ORIGIN_INVALID 0x80000000
|
---|
82 |
|
---|
83 | typedef struct _CompSubwindows {
|
---|
84 | int update;
|
---|
85 | CompClientWindowPtr clients;
|
---|
86 | } CompSubwindowsRec, *CompSubwindowsPtr;
|
---|
87 |
|
---|
88 | #ifndef COMP_INCLUDE_RGB24_VISUAL
|
---|
89 | #define COMP_INCLUDE_RGB24_VISUAL 0
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #if COMP_INCLUDE_RGB24_VISUAL
|
---|
93 | #define NUM_COMP_ALTERNATE_VISUALS 2
|
---|
94 | #else
|
---|
95 | #define NUM_COMP_ALTERNATE_VISUALS 1
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | typedef struct _CompScreen {
|
---|
99 | PositionWindowProcPtr PositionWindow;
|
---|
100 | CopyWindowProcPtr CopyWindow;
|
---|
101 | CreateWindowProcPtr CreateWindow;
|
---|
102 | DestroyWindowProcPtr DestroyWindow;
|
---|
103 | RealizeWindowProcPtr RealizeWindow;
|
---|
104 | UnrealizeWindowProcPtr UnrealizeWindow;
|
---|
105 | PaintWindowProcPtr PaintWindowBackground;
|
---|
106 | ClipNotifyProcPtr ClipNotify;
|
---|
107 | /*
|
---|
108 | * Called from ConfigureWindow, these
|
---|
109 | * three track changes to the offscreen storage
|
---|
110 | * geometry
|
---|
111 | */
|
---|
112 | MoveWindowProcPtr MoveWindow;
|
---|
113 | ResizeWindowProcPtr ResizeWindow;
|
---|
114 | ChangeBorderWidthProcPtr ChangeBorderWidth;
|
---|
115 | /*
|
---|
116 | * Reparenting has an effect on Subwindows redirect
|
---|
117 | */
|
---|
118 | ReparentWindowProcPtr ReparentWindow;
|
---|
119 |
|
---|
120 | /*
|
---|
121 | * Colormaps for new visuals better not get installed
|
---|
122 | */
|
---|
123 | InstallColormapProcPtr InstallColormap;
|
---|
124 |
|
---|
125 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
126 | CloseScreenProcPtr CloseScreen;
|
---|
127 | Bool damaged;
|
---|
128 | XID alternateVisuals[NUM_COMP_ALTERNATE_VISUALS];
|
---|
129 | } CompScreenRec, *CompScreenPtr;
|
---|
130 |
|
---|
131 | extern int CompScreenPrivateIndex;
|
---|
132 | extern int CompWindowPrivateIndex;
|
---|
133 | extern int CompSubwindowsPrivateIndex;
|
---|
134 |
|
---|
135 | #define GetCompScreen(s) ((CompScreenPtr) ((s)->devPrivates[CompScreenPrivateIndex].ptr))
|
---|
136 | #define GetCompWindow(w) ((CompWindowPtr) ((w)->devPrivates[CompWindowPrivateIndex].ptr))
|
---|
137 | #define GetCompSubwindows(w) ((CompSubwindowsPtr) ((w)->devPrivates[CompSubwindowsPrivateIndex].ptr))
|
---|
138 |
|
---|
139 | extern RESTYPE CompositeClientWindowType;
|
---|
140 | extern RESTYPE CompositeClientSubwindowsType;
|
---|
141 |
|
---|
142 | /*
|
---|
143 | * compalloc.c
|
---|
144 | */
|
---|
145 |
|
---|
146 | void
|
---|
147 | compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
|
---|
148 |
|
---|
149 | Bool
|
---|
150 | compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
151 |
|
---|
152 | void
|
---|
153 | compFreeClientWindow (WindowPtr pWin, XID id);
|
---|
154 |
|
---|
155 | int
|
---|
156 | compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
157 |
|
---|
158 | int
|
---|
159 | compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
160 |
|
---|
161 | void
|
---|
162 | compFreeClientSubwindows (WindowPtr pWin, XID id);
|
---|
163 |
|
---|
164 | int
|
---|
165 | compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
166 |
|
---|
167 | int
|
---|
168 | compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
169 |
|
---|
170 | int
|
---|
171 | compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
172 |
|
---|
173 | Bool
|
---|
174 | compAllocPixmap (WindowPtr pWin);
|
---|
175 |
|
---|
176 | void
|
---|
177 | compFreePixmap (WindowPtr pWin);
|
---|
178 |
|
---|
179 | Bool
|
---|
180 | compReallocPixmap (WindowPtr pWin, int x, int y,
|
---|
181 | unsigned int w, unsigned int h, int bw);
|
---|
182 |
|
---|
183 | /*
|
---|
184 | * compext.c
|
---|
185 | */
|
---|
186 |
|
---|
187 | void
|
---|
188 | CompositeExtensionInit (void);
|
---|
189 |
|
---|
190 | /*
|
---|
191 | * compinit.c
|
---|
192 | */
|
---|
193 |
|
---|
194 | Bool
|
---|
195 | compScreenInit (ScreenPtr pScreen);
|
---|
196 |
|
---|
197 | /*
|
---|
198 | * compwindow.c
|
---|
199 | */
|
---|
200 |
|
---|
201 | #ifdef COMPOSITE_DEBUG
|
---|
202 | void
|
---|
203 | compCheckTree (ScreenPtr pScreen);
|
---|
204 | #else
|
---|
205 | #define compCheckTree(s)
|
---|
206 | #endif
|
---|
207 |
|
---|
208 | void
|
---|
209 | compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
---|
210 |
|
---|
211 | Bool
|
---|
212 | compCheckRedirect (WindowPtr pWin);
|
---|
213 |
|
---|
214 | Bool
|
---|
215 | compPositionWindow (WindowPtr pWin, int x, int y);
|
---|
216 |
|
---|
217 | Bool
|
---|
218 | compRealizeWindow (WindowPtr pWin);
|
---|
219 |
|
---|
220 | Bool
|
---|
221 | compUnrealizeWindow (WindowPtr pWin);
|
---|
222 |
|
---|
223 | void
|
---|
224 | compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
|
---|
225 |
|
---|
226 | void
|
---|
227 | compClipNotify (WindowPtr pWin, int dx, int dy);
|
---|
228 |
|
---|
229 | void
|
---|
230 | compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
|
---|
231 |
|
---|
232 | void
|
---|
233 | compResizeWindow (WindowPtr pWin, int x, int y,
|
---|
234 | unsigned int w, unsigned int h, WindowPtr pSib);
|
---|
235 |
|
---|
236 | void
|
---|
237 | compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
|
---|
238 |
|
---|
239 | void
|
---|
240 | compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
|
---|
241 |
|
---|
242 | Bool
|
---|
243 | compCreateWindow (WindowPtr pWin);
|
---|
244 |
|
---|
245 | Bool
|
---|
246 | compDestroyWindow (WindowPtr pWin);
|
---|
247 |
|
---|
248 | void
|
---|
249 | compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
|
---|
250 |
|
---|
251 | RegionPtr
|
---|
252 | compGetRedirectBorderClip (WindowPtr pWin);
|
---|
253 |
|
---|
254 | void
|
---|
255 | compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
---|
256 |
|
---|
257 | void
|
---|
258 | compWindowUpdate (WindowPtr pWin);
|
---|
259 |
|
---|
260 | #endif /* _COMPINT_H_ */
|
---|