1 | /***********************************************************
|
---|
2 |
|
---|
3 | Copyright 1987, 1998 The Open Group
|
---|
4 |
|
---|
5 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | the above copyright notice appear in all copies and that both that
|
---|
8 | copyright notice and this permission notice appear in supporting
|
---|
9 | documentation.
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in
|
---|
12 | all copies or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
22 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
23 | in this Software without prior written authorization from The Open Group.
|
---|
24 |
|
---|
25 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
26 |
|
---|
27 | All Rights Reserved
|
---|
28 |
|
---|
29 | Permission to use, copy, modify, and distribute this software and its
|
---|
30 | documentation for any purpose and without fee is hereby granted,
|
---|
31 | provided that the above copyright notice appear in all copies and that
|
---|
32 | both that copyright notice and this permission notice appear in
|
---|
33 | supporting documentation, and that the name of Digital not be
|
---|
34 | used in advertising or publicity pertaining to distribution of the
|
---|
35 | software without specific, written prior permission.
|
---|
36 |
|
---|
37 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
38 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
39 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
40 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
41 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
42 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
43 | SOFTWARE.
|
---|
44 |
|
---|
45 | ******************************************************************/
|
---|
46 |
|
---|
47 | #ifndef SCREENINTSTRUCT_H
|
---|
48 | #define SCREENINTSTRUCT_H
|
---|
49 |
|
---|
50 | #include "screenint.h"
|
---|
51 | #include "regionstr.h"
|
---|
52 | #include "colormap.h"
|
---|
53 | #include "cursor.h"
|
---|
54 | #include "validate.h"
|
---|
55 | #include <X11/Xproto.h>
|
---|
56 | #include "dix.h"
|
---|
57 | #include "privates.h"
|
---|
58 |
|
---|
59 | typedef struct _PixmapFormat {
|
---|
60 | unsigned char depth;
|
---|
61 | unsigned char bitsPerPixel;
|
---|
62 | unsigned char scanlinePad;
|
---|
63 | } PixmapFormatRec;
|
---|
64 |
|
---|
65 | typedef struct _Visual {
|
---|
66 | VisualID vid;
|
---|
67 | short class;
|
---|
68 | short bitsPerRGBValue;
|
---|
69 | short ColormapEntries;
|
---|
70 | short nplanes; /* = log2 (ColormapEntries). This does not
|
---|
71 | * imply that the screen has this many planes.
|
---|
72 | * it may have more or fewer */
|
---|
73 | unsigned long redMask, greenMask, blueMask;
|
---|
74 | int offsetRed, offsetGreen, offsetBlue;
|
---|
75 | } VisualRec;
|
---|
76 |
|
---|
77 | typedef struct _Depth {
|
---|
78 | unsigned char depth;
|
---|
79 | short numVids;
|
---|
80 | VisualID *vids; /* block of visual ids for this depth */
|
---|
81 | } DepthRec;
|
---|
82 |
|
---|
83 | typedef struct _ScreenSaverStuff {
|
---|
84 | WindowPtr pWindow;
|
---|
85 | XID wid;
|
---|
86 | char blanked;
|
---|
87 | Bool (*ExternalScreenSaver) (ScreenPtr /*pScreen */ ,
|
---|
88 | int /*xstate */ ,
|
---|
89 | Bool /*force */ );
|
---|
90 | } ScreenSaverStuffRec;
|
---|
91 |
|
---|
92 | /*
|
---|
93 | * There is a typedef for each screen function pointer so that code that
|
---|
94 | * needs to declare a screen function pointer (e.g. in a screen private
|
---|
95 | * or as a local variable) can easily do so and retain full type checking.
|
---|
96 | */
|
---|
97 |
|
---|
98 | typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
|
---|
99 |
|
---|
100 | typedef void (*QueryBestSizeProcPtr) (int /*class */ ,
|
---|
101 | unsigned short * /*pwidth */ ,
|
---|
102 | unsigned short * /*pheight */ ,
|
---|
103 | ScreenPtr /*pScreen */ );
|
---|
104 |
|
---|
105 | typedef Bool (*SaveScreenProcPtr) (ScreenPtr /*pScreen */ ,
|
---|
106 | int /*on */ );
|
---|
107 |
|
---|
108 | typedef void (*GetImageProcPtr) (DrawablePtr /*pDrawable */ ,
|
---|
109 | int /*sx */ ,
|
---|
110 | int /*sy */ ,
|
---|
111 | int /*w */ ,
|
---|
112 | int /*h */ ,
|
---|
113 | unsigned int /*format */ ,
|
---|
114 | unsigned long /*planeMask */ ,
|
---|
115 | char * /*pdstLine */ );
|
---|
116 |
|
---|
117 | typedef void (*GetSpansProcPtr) (DrawablePtr /*pDrawable */ ,
|
---|
118 | int /*wMax */ ,
|
---|
119 | DDXPointPtr /*ppt */ ,
|
---|
120 | int * /*pwidth */ ,
|
---|
121 | int /*nspans */ ,
|
---|
122 | char * /*pdstStart */ );
|
---|
123 |
|
---|
124 | typedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ ,
|
---|
125 | int /*x */ ,
|
---|
126 | int /*y */ ,
|
---|
127 | int /*width */ ,
|
---|
128 | int /*height */ ,
|
---|
129 | unsigned int /*subWindowMode */ );
|
---|
130 |
|
---|
131 | typedef Bool (*CreateWindowProcPtr) (WindowPtr /*pWindow */ );
|
---|
132 |
|
---|
133 | typedef Bool (*DestroyWindowProcPtr) (WindowPtr /*pWindow */ );
|
---|
134 |
|
---|
135 | typedef Bool (*PositionWindowProcPtr) (WindowPtr /*pWindow */ ,
|
---|
136 | int /*x */ ,
|
---|
137 | int /*y */ );
|
---|
138 |
|
---|
139 | typedef Bool (*ChangeWindowAttributesProcPtr) (WindowPtr /*pWindow */ ,
|
---|
140 | unsigned long /*mask */ );
|
---|
141 |
|
---|
142 | typedef Bool (*RealizeWindowProcPtr) (WindowPtr /*pWindow */ );
|
---|
143 |
|
---|
144 | typedef Bool (*UnrealizeWindowProcPtr) (WindowPtr /*pWindow */ );
|
---|
145 |
|
---|
146 | typedef void (*RestackWindowProcPtr) (WindowPtr /*pWindow */ ,
|
---|
147 | WindowPtr /*pOldNextSib */ );
|
---|
148 |
|
---|
149 | typedef int (*ValidateTreeProcPtr) (WindowPtr /*pParent */ ,
|
---|
150 | WindowPtr /*pChild */ ,
|
---|
151 | VTKind /*kind */ );
|
---|
152 |
|
---|
153 | typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
|
---|
154 | WindowPtr /*pChild */ ,
|
---|
155 | VTKind /*kind */ );
|
---|
156 |
|
---|
157 | typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
|
---|
158 | RegionPtr /*prgn */);
|
---|
159 |
|
---|
160 | typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
|
---|
161 | DDXPointRec /*ptOldOrg */ ,
|
---|
162 | RegionPtr /*prgnSrc */ );
|
---|
163 |
|
---|
164 | typedef void (*ClearToBackgroundProcPtr) (WindowPtr /*pWindow */ ,
|
---|
165 | int /*x */ ,
|
---|
166 | int /*y */ ,
|
---|
167 | int /*w */ ,
|
---|
168 | int /*h */ ,
|
---|
169 | Bool /*generateExposures */ );
|
---|
170 |
|
---|
171 | typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ ,
|
---|
172 | int /*dx */ ,
|
---|
173 | int /*dy */ );
|
---|
174 |
|
---|
175 | /* pixmap will exist only for the duration of the current rendering operation */
|
---|
176 | #define CREATE_PIXMAP_USAGE_SCRATCH 1
|
---|
177 | /* pixmap will be the backing pixmap for a redirected window */
|
---|
178 | #define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
|
---|
179 | /* pixmap will contain a glyph */
|
---|
180 | #define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
|
---|
181 | /* pixmap will be shared */
|
---|
182 | #define CREATE_PIXMAP_USAGE_SHARED 4
|
---|
183 |
|
---|
184 | typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ ,
|
---|
185 | int /*width */ ,
|
---|
186 | int /*height */ ,
|
---|
187 | int /*depth */ ,
|
---|
188 | unsigned /*usage_hint */ );
|
---|
189 |
|
---|
190 | typedef Bool (*DestroyPixmapProcPtr) (PixmapPtr /*pPixmap */ );
|
---|
191 |
|
---|
192 | typedef Bool (*RealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
|
---|
193 | FontPtr /*pFont */ );
|
---|
194 |
|
---|
195 | typedef Bool (*UnrealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
|
---|
196 | FontPtr /*pFont */ );
|
---|
197 |
|
---|
198 | typedef void (*ConstrainCursorProcPtr) (DeviceIntPtr /*pDev */ ,
|
---|
199 | ScreenPtr /*pScreen */ ,
|
---|
200 | BoxPtr /*pBox */ );
|
---|
201 |
|
---|
202 | typedef void (*CursorLimitsProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
203 | ScreenPtr /*pScreen */ ,
|
---|
204 | CursorPtr /*pCursor */ ,
|
---|
205 | BoxPtr /*pHotBox */ ,
|
---|
206 | BoxPtr /*pTopLeftBox */ );
|
---|
207 |
|
---|
208 | typedef Bool (*DisplayCursorProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
209 | ScreenPtr /*pScreen */ ,
|
---|
210 | CursorPtr /*pCursor */ );
|
---|
211 |
|
---|
212 | typedef Bool (*RealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
213 | ScreenPtr /*pScreen */ ,
|
---|
214 | CursorPtr /*pCursor */ );
|
---|
215 |
|
---|
216 | typedef Bool (*UnrealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
217 | ScreenPtr /*pScreen */ ,
|
---|
218 | CursorPtr /*pCursor */ );
|
---|
219 |
|
---|
220 | typedef void (*RecolorCursorProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
221 | ScreenPtr /*pScreen */ ,
|
---|
222 | CursorPtr /*pCursor */ ,
|
---|
223 | Bool /*displayed */ );
|
---|
224 |
|
---|
225 | typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
226 | ScreenPtr /*pScreen */ ,
|
---|
227 | int /*x */ ,
|
---|
228 | int /*y */ ,
|
---|
229 | Bool /*generateEvent */ );
|
---|
230 |
|
---|
231 | typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
|
---|
232 |
|
---|
233 | typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
|
---|
234 |
|
---|
235 | typedef void (*DestroyColormapProcPtr) (ColormapPtr /*pColormap */ );
|
---|
236 |
|
---|
237 | typedef void (*InstallColormapProcPtr) (ColormapPtr /*pColormap */ );
|
---|
238 |
|
---|
239 | typedef void (*UninstallColormapProcPtr) (ColormapPtr /*pColormap */ );
|
---|
240 |
|
---|
241 | typedef int (*ListInstalledColormapsProcPtr) (ScreenPtr /*pScreen */ ,
|
---|
242 | XID * /*pmaps */ );
|
---|
243 |
|
---|
244 | typedef void (*StoreColorsProcPtr) (ColormapPtr /*pColormap */ ,
|
---|
245 | int /*ndef */ ,
|
---|
246 | xColorItem * /*pdef */ );
|
---|
247 |
|
---|
248 | typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
|
---|
249 | unsigned short * /*pgreen */ ,
|
---|
250 | unsigned short * /*pblue */ ,
|
---|
251 | VisualPtr /*pVisual */ );
|
---|
252 |
|
---|
253 | typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
|
---|
254 |
|
---|
255 | typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
|
---|
256 | void *pTimeout,
|
---|
257 | void *pReadmask);
|
---|
258 |
|
---|
259 | typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen,
|
---|
260 | unsigned long result,
|
---|
261 | void *pReadMask);
|
---|
262 |
|
---|
263 | typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ );
|
---|
264 |
|
---|
265 | typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap,
|
---|
266 | int width,
|
---|
267 | int height,
|
---|
268 | int depth,
|
---|
269 | int bitsPerPixel,
|
---|
270 | int devKind,
|
---|
271 | void *pPixData);
|
---|
272 |
|
---|
273 | typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ );
|
---|
274 |
|
---|
275 | typedef void (*SetWindowPixmapProcPtr) (WindowPtr /*pWin */ ,
|
---|
276 | PixmapPtr /*pPix */ );
|
---|
277 |
|
---|
278 | typedef PixmapPtr (*GetScreenPixmapProcPtr) (ScreenPtr /*pScreen */ );
|
---|
279 |
|
---|
280 | typedef void (*SetScreenPixmapProcPtr) (PixmapPtr /*pPix */ );
|
---|
281 |
|
---|
282 | typedef void (*MarkWindowProcPtr) (WindowPtr /*pWin */ );
|
---|
283 |
|
---|
284 | typedef Bool (*MarkOverlappedWindowsProcPtr) (WindowPtr /*parent */ ,
|
---|
285 | WindowPtr /*firstChild */ ,
|
---|
286 | WindowPtr * /*pLayerWin */ );
|
---|
287 |
|
---|
288 | typedef int (*ConfigNotifyProcPtr) (WindowPtr /*pWin */ ,
|
---|
289 | int /*x */ ,
|
---|
290 | int /*y */ ,
|
---|
291 | int /*w */ ,
|
---|
292 | int /*h */ ,
|
---|
293 | int /*bw */ ,
|
---|
294 | WindowPtr /*pSib */ );
|
---|
295 |
|
---|
296 | typedef void (*MoveWindowProcPtr) (WindowPtr /*pWin */ ,
|
---|
297 | int /*x */ ,
|
---|
298 | int /*y */ ,
|
---|
299 | WindowPtr /*pSib */ ,
|
---|
300 | VTKind /*kind */ );
|
---|
301 |
|
---|
302 | typedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ ,
|
---|
303 | int /*x */ ,
|
---|
304 | int /*y */ ,
|
---|
305 | unsigned int /*w */ ,
|
---|
306 | unsigned int /*h */ ,
|
---|
307 | WindowPtr /*pSib */
|
---|
308 | );
|
---|
309 |
|
---|
310 | typedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr /*pWin */
|
---|
311 | );
|
---|
312 |
|
---|
313 | typedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ );
|
---|
314 |
|
---|
315 | typedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ ,
|
---|
316 | WindowPtr /*pPriorParent */ );
|
---|
317 |
|
---|
318 | typedef void (*SetShapeProcPtr) (WindowPtr /*pWin */ ,
|
---|
319 | int /* kind */ );
|
---|
320 |
|
---|
321 | typedef void (*ChangeBorderWidthProcPtr) (WindowPtr /*pWin */ ,
|
---|
322 | unsigned int /*width */ );
|
---|
323 |
|
---|
324 | typedef void (*MarkUnrealizedWindowProcPtr) (WindowPtr /*pChild */ ,
|
---|
325 | WindowPtr /*pWin */ ,
|
---|
326 | Bool /*fromConfigure */ );
|
---|
327 |
|
---|
328 | typedef Bool (*DeviceCursorInitializeProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
329 | ScreenPtr /* pScreen */ );
|
---|
330 |
|
---|
331 | typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,
|
---|
332 | ScreenPtr /* pScreen */ );
|
---|
333 |
|
---|
334 | typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,
|
---|
335 | int *, int *);
|
---|
336 |
|
---|
337 |
|
---|
338 | typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
|
---|
339 |
|
---|
340 | typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
|
---|
341 |
|
---|
342 | typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr,
|
---|
343 | int x, int y);
|
---|
344 |
|
---|
345 | typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr);
|
---|
346 |
|
---|
347 | typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
|
---|
348 |
|
---|
349 | typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen,
|
---|
350 | SpritePtr pSprite, int x, int y);
|
---|
351 |
|
---|
352 | typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32);
|
---|
353 |
|
---|
354 | /* Wrapping Screen procedures
|
---|
355 |
|
---|
356 | There are a few modules in the X server which dynamically add and
|
---|
357 | remove themselves from various screen procedure call chains.
|
---|
358 |
|
---|
359 | For example, the BlockHandler is dynamically modified by:
|
---|
360 |
|
---|
361 | * xf86Rotate
|
---|
362 | * miSprite
|
---|
363 | * composite
|
---|
364 | * render (for animated cursors)
|
---|
365 |
|
---|
366 | Correctly manipulating this chain is complicated by the fact that
|
---|
367 | the chain is constructed through a sequence of screen private
|
---|
368 | structures, each holding the next screen->proc pointer.
|
---|
369 |
|
---|
370 | To add a module to a screen->proc chain is fairly simple; just save
|
---|
371 | the current screen->proc value in the module screen private
|
---|
372 | and store the module's function in the screen->proc location.
|
---|
373 |
|
---|
374 | Removing a screen proc is a bit trickier. It seems like all you
|
---|
375 | need to do is set the screen->proc pointer back to the value saved
|
---|
376 | in your screen private. However, if some other module has come
|
---|
377 | along and wrapped on top of you, then the right place to store the
|
---|
378 | previous screen->proc value is actually in the wrapping module's
|
---|
379 | screen private structure(!). Of course, you have no idea what
|
---|
380 | other module may have wrapped on top, nor could you poke inside
|
---|
381 | its screen private in any case.
|
---|
382 |
|
---|
383 | To make this work, we restrict the unwrapping process to happen
|
---|
384 | during the invocation of the screen proc itself, and then we
|
---|
385 | require the screen proc to take some care when manipulating the
|
---|
386 | screen proc functions pointers.
|
---|
387 |
|
---|
388 | The requirements are:
|
---|
389 |
|
---|
390 | 1) The screen proc must set the screen->proc pointer back to the
|
---|
391 | value saved in its screen private before calling outside its
|
---|
392 | module.
|
---|
393 |
|
---|
394 | 2a) If the screen proc wants to be remove itself from the chain,
|
---|
395 | it must not manipulate screen->proc pointer again before
|
---|
396 | returning.
|
---|
397 |
|
---|
398 | 2b) If the screen proc wants to remain in the chain, it must:
|
---|
399 |
|
---|
400 | 2b.1) Re-fetch the screen->proc pointer and store that in
|
---|
401 | its screen private. This ensures that any changes
|
---|
402 | to the chain will be preserved.
|
---|
403 |
|
---|
404 | 2b.2) Set screen->proc back to itself
|
---|
405 |
|
---|
406 | One key requirement here is that these steps must wrap not just
|
---|
407 | any invocation of the nested screen->proc value, but must nest
|
---|
408 | essentially any calls outside the current module. This ensures
|
---|
409 | that other modules can reliably manipulate screen->proc wrapping
|
---|
410 | using these same rules.
|
---|
411 |
|
---|
412 | For example, the animated cursor code in render has two macros,
|
---|
413 | Wrap and Unwrap.
|
---|
414 |
|
---|
415 | #define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
---|
416 |
|
---|
417 | Unwrap takes the screen private (as), the screen (s) and the
|
---|
418 | member name (elt), and restores screen->proc to that saved in the
|
---|
419 | screen private.
|
---|
420 |
|
---|
421 | #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
|
---|
422 |
|
---|
423 | Wrap takes the screen private (as), the screen (s), the member
|
---|
424 | name (elt) and the wrapping function (func). It saves the
|
---|
425 | current screen->proc value in the screen private, and then sets the
|
---|
426 | screen->proc to the local wrapping function.
|
---|
427 |
|
---|
428 | Within each of these functions, there's a pretty simple pattern:
|
---|
429 |
|
---|
430 | Unwrap(as, pScreen, UnrealizeCursor);
|
---|
431 |
|
---|
432 | // Do local stuff, including possibly calling down through
|
---|
433 | // pScreen->UnrealizeCursor
|
---|
434 |
|
---|
435 | Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
---|
436 |
|
---|
437 | The wrapping block handler is a bit different; it does the Unwrap,
|
---|
438 | the local operations and then only re-Wraps if the hook is still
|
---|
439 | required. Unwrap occurrs at the top of each function, just after
|
---|
440 | entry, and Wrap occurrs at the bottom of each function, just
|
---|
441 | before returning.
|
---|
442 | */
|
---|
443 |
|
---|
444 | typedef struct _Screen {
|
---|
445 | int myNum; /* index of this instance in Screens[] */
|
---|
446 | ATOM id;
|
---|
447 | short x, y, width, height;
|
---|
448 | short mmWidth, mmHeight;
|
---|
449 | short numDepths;
|
---|
450 | unsigned char rootDepth;
|
---|
451 | DepthPtr allowedDepths;
|
---|
452 | unsigned long rootVisual;
|
---|
453 | unsigned long defColormap;
|
---|
454 | short minInstalledCmaps, maxInstalledCmaps;
|
---|
455 | char backingStoreSupport, saveUnderSupport;
|
---|
456 | unsigned long whitePixel, blackPixel;
|
---|
457 | GCPtr GCperDepth[MAXFORMATS + 1];
|
---|
458 | /* next field is a stipple to use as default in
|
---|
459 | a GC. we don't build default tiles of all depths
|
---|
460 | because they are likely to be of a color
|
---|
461 | different from the default fg pixel, so
|
---|
462 | we don't win anything by building
|
---|
463 | a standard one.
|
---|
464 | */
|
---|
465 | PixmapPtr PixmapPerDepth[1];
|
---|
466 | void *devPrivate;
|
---|
467 | short numVisuals;
|
---|
468 | VisualPtr visuals;
|
---|
469 | WindowPtr root;
|
---|
470 | ScreenSaverStuffRec screensaver;
|
---|
471 |
|
---|
472 | DevPrivateSetRec screenSpecificPrivates[PRIVATE_LAST];
|
---|
473 |
|
---|
474 | /* Random screen procedures */
|
---|
475 |
|
---|
476 | CloseScreenProcPtr CloseScreen;
|
---|
477 | QueryBestSizeProcPtr QueryBestSize;
|
---|
478 | SaveScreenProcPtr SaveScreen;
|
---|
479 | GetImageProcPtr GetImage;
|
---|
480 | GetSpansProcPtr GetSpans;
|
---|
481 | SourceValidateProcPtr SourceValidate;
|
---|
482 |
|
---|
483 | /* Window Procedures */
|
---|
484 |
|
---|
485 | CreateWindowProcPtr CreateWindow;
|
---|
486 | DestroyWindowProcPtr DestroyWindow;
|
---|
487 | PositionWindowProcPtr PositionWindow;
|
---|
488 | ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
---|
489 | RealizeWindowProcPtr RealizeWindow;
|
---|
490 | UnrealizeWindowProcPtr UnrealizeWindow;
|
---|
491 | ValidateTreeProcPtr ValidateTree;
|
---|
492 | PostValidateTreeProcPtr PostValidateTree;
|
---|
493 | WindowExposuresProcPtr WindowExposures;
|
---|
494 | CopyWindowProcPtr CopyWindow;
|
---|
495 | ClearToBackgroundProcPtr ClearToBackground;
|
---|
496 | ClipNotifyProcPtr ClipNotify;
|
---|
497 | RestackWindowProcPtr RestackWindow;
|
---|
498 |
|
---|
499 | /* Pixmap procedures */
|
---|
500 |
|
---|
501 | CreatePixmapProcPtr CreatePixmap;
|
---|
502 | DestroyPixmapProcPtr DestroyPixmap;
|
---|
503 |
|
---|
504 | /* Font procedures */
|
---|
505 |
|
---|
506 | RealizeFontProcPtr RealizeFont;
|
---|
507 | UnrealizeFontProcPtr UnrealizeFont;
|
---|
508 |
|
---|
509 | /* Cursor Procedures */
|
---|
510 |
|
---|
511 | ConstrainCursorProcPtr ConstrainCursor;
|
---|
512 | ConstrainCursorHarderProcPtr ConstrainCursorHarder;
|
---|
513 | CursorLimitsProcPtr CursorLimits;
|
---|
514 | DisplayCursorProcPtr DisplayCursor;
|
---|
515 | RealizeCursorProcPtr RealizeCursor;
|
---|
516 | UnrealizeCursorProcPtr UnrealizeCursor;
|
---|
517 | RecolorCursorProcPtr RecolorCursor;
|
---|
518 | SetCursorPositionProcPtr SetCursorPosition;
|
---|
519 |
|
---|
520 | /* GC procedures */
|
---|
521 |
|
---|
522 | CreateGCProcPtr CreateGC;
|
---|
523 |
|
---|
524 | /* Colormap procedures */
|
---|
525 |
|
---|
526 | CreateColormapProcPtr CreateColormap;
|
---|
527 | DestroyColormapProcPtr DestroyColormap;
|
---|
528 | InstallColormapProcPtr InstallColormap;
|
---|
529 | UninstallColormapProcPtr UninstallColormap;
|
---|
530 | ListInstalledColormapsProcPtr ListInstalledColormaps;
|
---|
531 | StoreColorsProcPtr StoreColors;
|
---|
532 | ResolveColorProcPtr ResolveColor;
|
---|
533 |
|
---|
534 | /* Region procedures */
|
---|
535 |
|
---|
536 | BitmapToRegionProcPtr BitmapToRegion;
|
---|
537 |
|
---|
538 | /* os layer procedures */
|
---|
539 |
|
---|
540 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
541 | ScreenWakeupHandlerProcPtr WakeupHandler;
|
---|
542 |
|
---|
543 | /* anybody can get a piece of this array */
|
---|
544 | PrivateRec *devPrivates;
|
---|
545 |
|
---|
546 | CreateScreenResourcesProcPtr CreateScreenResources;
|
---|
547 | ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
|
---|
548 |
|
---|
549 | GetWindowPixmapProcPtr GetWindowPixmap;
|
---|
550 | SetWindowPixmapProcPtr SetWindowPixmap;
|
---|
551 | GetScreenPixmapProcPtr GetScreenPixmap;
|
---|
552 | SetScreenPixmapProcPtr SetScreenPixmap;
|
---|
553 | NameWindowPixmapProcPtr NameWindowPixmap;
|
---|
554 |
|
---|
555 | PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
|
---|
556 |
|
---|
557 | unsigned int totalPixmapSize;
|
---|
558 |
|
---|
559 | MarkWindowProcPtr MarkWindow;
|
---|
560 | MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
|
---|
561 | ConfigNotifyProcPtr ConfigNotify;
|
---|
562 | MoveWindowProcPtr MoveWindow;
|
---|
563 | ResizeWindowProcPtr ResizeWindow;
|
---|
564 | GetLayerWindowProcPtr GetLayerWindow;
|
---|
565 | HandleExposuresProcPtr HandleExposures;
|
---|
566 | ReparentWindowProcPtr ReparentWindow;
|
---|
567 |
|
---|
568 | SetShapeProcPtr SetShape;
|
---|
569 |
|
---|
570 | ChangeBorderWidthProcPtr ChangeBorderWidth;
|
---|
571 | MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
|
---|
572 |
|
---|
573 | /* Device cursor procedures */
|
---|
574 | DeviceCursorInitializeProcPtr DeviceCursorInitialize;
|
---|
575 | DeviceCursorCleanupProcPtr DeviceCursorCleanup;
|
---|
576 |
|
---|
577 | /* set it in driver side if X server can copy the framebuffer content.
|
---|
578 | * Meant to be used together with '-background none' option, avoiding
|
---|
579 | * malicious users to steal framebuffer's content if that would be the
|
---|
580 | * default */
|
---|
581 | Bool canDoBGNoneRoot;
|
---|
582 |
|
---|
583 | Bool isGPU;
|
---|
584 |
|
---|
585 | struct xorg_list unattached_list;
|
---|
586 | struct xorg_list unattached_head;
|
---|
587 |
|
---|
588 | ScreenPtr current_master;
|
---|
589 |
|
---|
590 | struct xorg_list output_slave_list;
|
---|
591 | struct xorg_list output_head;
|
---|
592 |
|
---|
593 | SharePixmapBackingProcPtr SharePixmapBacking;
|
---|
594 | SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;
|
---|
595 |
|
---|
596 | StartPixmapTrackingProcPtr StartPixmapTracking;
|
---|
597 | StopPixmapTrackingProcPtr StopPixmapTracking;
|
---|
598 |
|
---|
599 | struct xorg_list pixmap_dirty_list;
|
---|
600 | struct xorg_list offload_slave_list;
|
---|
601 | struct xorg_list offload_head;
|
---|
602 |
|
---|
603 | ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap;
|
---|
604 | XYToWindowProcPtr XYToWindow;
|
---|
605 | } ScreenRec;
|
---|
606 |
|
---|
607 | static inline RegionPtr
|
---|
608 | BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix)
|
---|
609 | {
|
---|
610 | return (*(_pScreen)->BitmapToRegion) (pPix); /* no mi version?! */
|
---|
611 | }
|
---|
612 |
|
---|
613 | typedef struct _ScreenInfo {
|
---|
614 | int imageByteOrder;
|
---|
615 | int bitmapScanlineUnit;
|
---|
616 | int bitmapScanlinePad;
|
---|
617 | int bitmapBitOrder;
|
---|
618 | int numPixmapFormats;
|
---|
619 | PixmapFormatRec formats[MAXFORMATS];
|
---|
620 | int numScreens;
|
---|
621 | ScreenPtr screens[MAXSCREENS];
|
---|
622 | int numGPUScreens;
|
---|
623 | ScreenPtr gpuscreens[MAXGPUSCREENS];
|
---|
624 | int x; /* origin */
|
---|
625 | int y; /* origin */
|
---|
626 | int width; /* total width of all screens together */
|
---|
627 | int height; /* total height of all screens together */
|
---|
628 | } ScreenInfo;
|
---|
629 |
|
---|
630 | extern _X_EXPORT ScreenInfo screenInfo;
|
---|
631 |
|
---|
632 | extern _X_EXPORT void InitOutput(ScreenInfo * /*pScreenInfo */ ,
|
---|
633 | int /*argc */ ,
|
---|
634 | char ** /*argv */ );
|
---|
635 |
|
---|
636 | #endif /* SCREENINTSTRUCT_H */
|
---|