VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/1.4/xorg/scrnintstr.h@ 41328

Last change on this file since 41328 was 17236, checked in by vboxsync, 16 years ago

Additions/x11/x11include: blast! Reverted r43555 and r43556

  • Property svn:eol-style set to native
File size: 15.8 KB
Line 
1/***********************************************************
2
3Copyright 1987, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28 All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46******************************************************************/
47
48#ifndef SCREENINTSTRUCT_H
49#define SCREENINTSTRUCT_H
50
51#include "screenint.h"
52#include "regionstr.h"
53#include "bstore.h"
54#include "colormap.h"
55#include "cursor.h"
56#include "validate.h"
57#include <X11/Xproto.h>
58#include "dix.h"
59
60typedef struct _PixmapFormat {
61 unsigned char depth;
62 unsigned char bitsPerPixel;
63 unsigned char scanlinePad;
64 } PixmapFormatRec;
65
66typedef struct _Visual {
67 VisualID vid;
68 short class;
69 short bitsPerRGBValue;
70 short ColormapEntries;
71 short nplanes;/* = log2 (ColormapEntries). This does not
72 * imply that the screen has this many planes.
73 * it may have more or fewer */
74 unsigned long redMask, greenMask, blueMask;
75 int offsetRed, offsetGreen, offsetBlue;
76 } VisualRec;
77
78typedef struct _Depth {
79 unsigned char depth;
80 short numVids;
81 VisualID *vids; /* block of visual ids for this depth */
82 } DepthRec;
83
84
85/*
86 * There is a typedef for each screen function pointer so that code that
87 * needs to declare a screen function pointer (e.g. in a screen private
88 * or as a local variable) can easily do so and retain full type checking.
89 */
90
91typedef Bool (* CloseScreenProcPtr)(
92 int /*index*/,
93 ScreenPtr /*pScreen*/);
94
95typedef void (* QueryBestSizeProcPtr)(
96 int /*class*/,
97 unsigned short * /*pwidth*/,
98 unsigned short * /*pheight*/,
99 ScreenPtr /*pScreen*/);
100
101typedef Bool (* SaveScreenProcPtr)(
102 ScreenPtr /*pScreen*/,
103 int /*on*/);
104
105typedef void (* GetImageProcPtr)(
106 DrawablePtr /*pDrawable*/,
107 int /*sx*/,
108 int /*sy*/,
109 int /*w*/,
110 int /*h*/,
111 unsigned int /*format*/,
112 unsigned long /*planeMask*/,
113 char * /*pdstLine*/);
114
115typedef void (* GetSpansProcPtr)(
116 DrawablePtr /*pDrawable*/,
117 int /*wMax*/,
118 DDXPointPtr /*ppt*/,
119 int* /*pwidth*/,
120 int /*nspans*/,
121 char * /*pdstStart*/);
122
123typedef void (* PointerNonInterestBoxProcPtr)(
124 ScreenPtr /*pScreen*/,
125 BoxPtr /*pBox*/);
126
127typedef void (* SourceValidateProcPtr)(
128 DrawablePtr /*pDrawable*/,
129 int /*x*/,
130 int /*y*/,
131 int /*width*/,
132 int /*height*/);
133
134typedef Bool (* CreateWindowProcPtr)(
135 WindowPtr /*pWindow*/);
136
137typedef Bool (* DestroyWindowProcPtr)(
138 WindowPtr /*pWindow*/);
139
140typedef Bool (* PositionWindowProcPtr)(
141 WindowPtr /*pWindow*/,
142 int /*x*/,
143 int /*y*/);
144
145typedef Bool (* ChangeWindowAttributesProcPtr)(
146 WindowPtr /*pWindow*/,
147 unsigned long /*mask*/);
148
149typedef Bool (* RealizeWindowProcPtr)(
150 WindowPtr /*pWindow*/);
151
152typedef Bool (* UnrealizeWindowProcPtr)(
153 WindowPtr /*pWindow*/);
154
155typedef void (* RestackWindowProcPtr)(
156 WindowPtr /*pWindow*/,
157 WindowPtr /*pOldNextSib*/);
158
159typedef int (* ValidateTreeProcPtr)(
160 WindowPtr /*pParent*/,
161 WindowPtr /*pChild*/,
162 VTKind /*kind*/);
163
164typedef void (* PostValidateTreeProcPtr)(
165 WindowPtr /*pParent*/,
166 WindowPtr /*pChild*/,
167 VTKind /*kind*/);
168
169typedef void (* WindowExposuresProcPtr)(
170 WindowPtr /*pWindow*/,
171 RegionPtr /*prgn*/,
172 RegionPtr /*other_exposed*/);
173
174typedef void (* PaintWindowProcPtr)(
175 WindowPtr /*pWindow*/,
176 RegionPtr /*pRegion*/,
177 int /*what*/);
178
179typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
180typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
181
182typedef void (* CopyWindowProcPtr)(
183 WindowPtr /*pWindow*/,
184 DDXPointRec /*ptOldOrg*/,
185 RegionPtr /*prgnSrc*/);
186
187typedef void (* ClearToBackgroundProcPtr)(
188 WindowPtr /*pWindow*/,
189 int /*x*/,
190 int /*y*/,
191 int /*w*/,
192 int /*h*/,
193 Bool /*generateExposures*/);
194
195typedef void (* ClipNotifyProcPtr)(
196 WindowPtr /*pWindow*/,
197 int /*dx*/,
198 int /*dy*/);
199
200typedef PixmapPtr (* CreatePixmapProcPtr)(
201 ScreenPtr /*pScreen*/,
202 int /*width*/,
203 int /*height*/,
204 int /*depth*/);
205
206typedef Bool (* DestroyPixmapProcPtr)(
207 PixmapPtr /*pPixmap*/);
208
209typedef void (* SaveDoomedAreasProcPtr)(
210 WindowPtr /*pWindow*/,
211 RegionPtr /*prgnSave*/,
212 int /*xorg*/,
213 int /*yorg*/);
214
215typedef RegionPtr (* RestoreAreasProcPtr)(
216 WindowPtr /*pWindow*/,
217 RegionPtr /*prgnRestore*/);
218
219typedef void (* ExposeCopyProcPtr)(
220 WindowPtr /*pSrc*/,
221 DrawablePtr /*pDst*/,
222 GCPtr /*pGC*/,
223 RegionPtr /*prgnExposed*/,
224 int /*srcx*/,
225 int /*srcy*/,
226 int /*dstx*/,
227 int /*dsty*/,
228 unsigned long /*plane*/);
229
230typedef RegionPtr (* TranslateBackingStoreProcPtr)(
231 WindowPtr /*pWindow*/,
232 int /*windx*/,
233 int /*windy*/,
234 RegionPtr /*oldClip*/,
235 int /*oldx*/,
236 int /*oldy*/);
237
238typedef RegionPtr (* ClearBackingStoreProcPtr)(
239 WindowPtr /*pWindow*/,
240 int /*x*/,
241 int /*y*/,
242 int /*w*/,
243 int /*h*/,
244 Bool /*generateExposures*/);
245
246typedef void (* DrawGuaranteeProcPtr)(
247 WindowPtr /*pWindow*/,
248 GCPtr /*pGC*/,
249 int /*guarantee*/);
250
251typedef Bool (* RealizeFontProcPtr)(
252 ScreenPtr /*pScreen*/,
253 FontPtr /*pFont*/);
254
255typedef Bool (* UnrealizeFontProcPtr)(
256 ScreenPtr /*pScreen*/,
257 FontPtr /*pFont*/);
258
259typedef void (* ConstrainCursorProcPtr)(
260 ScreenPtr /*pScreen*/,
261 BoxPtr /*pBox*/);
262
263typedef void (* CursorLimitsProcPtr)(
264 ScreenPtr /*pScreen*/,
265 CursorPtr /*pCursor*/,
266 BoxPtr /*pHotBox*/,
267 BoxPtr /*pTopLeftBox*/);
268
269typedef Bool (* DisplayCursorProcPtr)(
270 ScreenPtr /*pScreen*/,
271 CursorPtr /*pCursor*/);
272
273typedef Bool (* RealizeCursorProcPtr)(
274 ScreenPtr /*pScreen*/,
275 CursorPtr /*pCursor*/);
276
277typedef Bool (* UnrealizeCursorProcPtr)(
278 ScreenPtr /*pScreen*/,
279 CursorPtr /*pCursor*/);
280
281typedef void (* RecolorCursorProcPtr)(
282 ScreenPtr /*pScreen*/,
283 CursorPtr /*pCursor*/,
284 Bool /*displayed*/);
285
286typedef Bool (* SetCursorPositionProcPtr)(
287 ScreenPtr /*pScreen*/,
288 int /*x*/,
289 int /*y*/,
290 Bool /*generateEvent*/);
291
292typedef Bool (* CreateGCProcPtr)(
293 GCPtr /*pGC*/);
294
295typedef Bool (* CreateColormapProcPtr)(
296 ColormapPtr /*pColormap*/);
297
298typedef void (* DestroyColormapProcPtr)(
299 ColormapPtr /*pColormap*/);
300
301typedef void (* InstallColormapProcPtr)(
302 ColormapPtr /*pColormap*/);
303
304typedef void (* UninstallColormapProcPtr)(
305 ColormapPtr /*pColormap*/);
306
307typedef int (* ListInstalledColormapsProcPtr) (
308 ScreenPtr /*pScreen*/,
309 XID* /*pmaps */);
310
311typedef void (* StoreColorsProcPtr)(
312 ColormapPtr /*pColormap*/,
313 int /*ndef*/,
314 xColorItem * /*pdef*/);
315
316typedef void (* ResolveColorProcPtr)(
317 unsigned short* /*pred*/,
318 unsigned short* /*pgreen*/,
319 unsigned short* /*pblue*/,
320 VisualPtr /*pVisual*/);
321
322typedef RegionPtr (* BitmapToRegionProcPtr)(
323 PixmapPtr /*pPix*/);
324
325typedef void (* SendGraphicsExposeProcPtr)(
326 ClientPtr /*client*/,
327 RegionPtr /*pRgn*/,
328 XID /*drawable*/,
329 int /*major*/,
330 int /*minor*/);
331
332typedef void (* ScreenBlockHandlerProcPtr)(
333 int /*screenNum*/,
334 pointer /*blockData*/,
335 pointer /*pTimeout*/,
336 pointer /*pReadmask*/);
337
338typedef void (* ScreenWakeupHandlerProcPtr)(
339 int /*screenNum*/,
340 pointer /*wakeupData*/,
341 unsigned long /*result*/,
342 pointer /*pReadMask*/);
343
344typedef Bool (* CreateScreenResourcesProcPtr)(
345 ScreenPtr /*pScreen*/);
346
347typedef Bool (* ModifyPixmapHeaderProcPtr)(
348 PixmapPtr /*pPixmap*/,
349 int /*width*/,
350 int /*height*/,
351 int /*depth*/,
352 int /*bitsPerPixel*/,
353 int /*devKind*/,
354 pointer /*pPixData*/);
355
356typedef PixmapPtr (* GetWindowPixmapProcPtr)(
357 WindowPtr /*pWin*/);
358
359typedef void (* SetWindowPixmapProcPtr)(
360 WindowPtr /*pWin*/,
361 PixmapPtr /*pPix*/);
362
363typedef PixmapPtr (* GetScreenPixmapProcPtr)(
364 ScreenPtr /*pScreen*/);
365
366typedef void (* SetScreenPixmapProcPtr)(
367 PixmapPtr /*pPix*/);
368
369typedef void (* MarkWindowProcPtr)(
370 WindowPtr /*pWin*/);
371
372typedef Bool (* MarkOverlappedWindowsProcPtr)(
373 WindowPtr /*parent*/,
374 WindowPtr /*firstChild*/,
375 WindowPtr * /*pLayerWin*/);
376
377typedef Bool (* ChangeSaveUnderProcPtr)(
378 WindowPtr /*pLayerWin*/,
379 WindowPtr /*firstChild*/);
380
381typedef void (* PostChangeSaveUnderProcPtr)(
382 WindowPtr /*pLayerWin*/,
383 WindowPtr /*firstChild*/);
384
385typedef void (* MoveWindowProcPtr)(
386 WindowPtr /*pWin*/,
387 int /*x*/,
388 int /*y*/,
389 WindowPtr /*pSib*/,
390 VTKind /*kind*/);
391
392typedef void (* ResizeWindowProcPtr)(
393 WindowPtr /*pWin*/,
394 int /*x*/,
395 int /*y*/,
396 unsigned int /*w*/,
397 unsigned int /*h*/,
398 WindowPtr /*pSib*/
399);
400
401typedef WindowPtr (* GetLayerWindowProcPtr)(
402 WindowPtr /*pWin*/
403);
404
405typedef void (* HandleExposuresProcPtr)(
406 WindowPtr /*pWin*/);
407
408typedef void (* ReparentWindowProcPtr)(
409 WindowPtr /*pWin*/,
410 WindowPtr /*pPriorParent*/);
411
412#ifdef SHAPE
413typedef void (* SetShapeProcPtr)(
414 WindowPtr /*pWin*/);
415#endif /* SHAPE */
416
417typedef void (* ChangeBorderWidthProcPtr)(
418 WindowPtr /*pWin*/,
419 unsigned int /*width*/);
420
421typedef void (* MarkUnrealizedWindowProcPtr)(
422 WindowPtr /*pChild*/,
423 WindowPtr /*pWin*/,
424 Bool /*fromConfigure*/);
425
426typedef struct _Screen {
427 int myNum; /* index of this instance in Screens[] */
428 ATOM id;
429 short width, height;
430 short mmWidth, mmHeight;
431 short numDepths;
432 unsigned char rootDepth;
433 DepthPtr allowedDepths;
434 unsigned long rootVisual;
435 unsigned long defColormap;
436 short minInstalledCmaps, maxInstalledCmaps;
437 char backingStoreSupport, saveUnderSupport;
438 unsigned long whitePixel, blackPixel;
439 unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
440 GCPtr GCperDepth[MAXFORMATS+1];
441 /* next field is a stipple to use as default in
442 a GC. we don't build default tiles of all depths
443 because they are likely to be of a color
444 different from the default fg pixel, so
445 we don't win anything by building
446 a standard one.
447 */
448 PixmapPtr PixmapPerDepth[1];
449 pointer devPrivate;
450 short numVisuals;
451 VisualPtr visuals;
452 int WindowPrivateLen;
453 unsigned *WindowPrivateSizes;
454 unsigned totalWindowSize;
455 int GCPrivateLen;
456 unsigned *GCPrivateSizes;
457 unsigned totalGCSize;
458
459 /* Random screen procedures */
460
461 CloseScreenProcPtr CloseScreen;
462 QueryBestSizeProcPtr QueryBestSize;
463 SaveScreenProcPtr SaveScreen;
464 GetImageProcPtr GetImage;
465 GetSpansProcPtr GetSpans;
466 PointerNonInterestBoxProcPtr PointerNonInterestBox;
467 SourceValidateProcPtr SourceValidate;
468
469 /* Window Procedures */
470
471 CreateWindowProcPtr CreateWindow;
472 DestroyWindowProcPtr DestroyWindow;
473 PositionWindowProcPtr PositionWindow;
474 ChangeWindowAttributesProcPtr ChangeWindowAttributes;
475 RealizeWindowProcPtr RealizeWindow;
476 UnrealizeWindowProcPtr UnrealizeWindow;
477 ValidateTreeProcPtr ValidateTree;
478 PostValidateTreeProcPtr PostValidateTree;
479 WindowExposuresProcPtr WindowExposures;
480 PaintWindowBackgroundProcPtr PaintWindowBackground;
481 PaintWindowBorderProcPtr PaintWindowBorder;
482 CopyWindowProcPtr CopyWindow;
483 ClearToBackgroundProcPtr ClearToBackground;
484 ClipNotifyProcPtr ClipNotify;
485 RestackWindowProcPtr RestackWindow;
486
487 /* Pixmap procedures */
488
489 CreatePixmapProcPtr CreatePixmap;
490 DestroyPixmapProcPtr DestroyPixmap;
491
492 /* Backing store procedures */
493
494 SaveDoomedAreasProcPtr SaveDoomedAreas;
495 RestoreAreasProcPtr RestoreAreas;
496 ExposeCopyProcPtr ExposeCopy;
497 TranslateBackingStoreProcPtr TranslateBackingStore;
498 ClearBackingStoreProcPtr ClearBackingStore;
499 DrawGuaranteeProcPtr DrawGuarantee;
500 /*
501 * A read/write copy of the lower level backing store vector is needed now
502 * that the functions can be wrapped.
503 */
504 BSFuncRec BackingStoreFuncs;
505
506 /* Font procedures */
507
508 RealizeFontProcPtr RealizeFont;
509 UnrealizeFontProcPtr UnrealizeFont;
510
511 /* Cursor Procedures */
512
513 ConstrainCursorProcPtr ConstrainCursor;
514 CursorLimitsProcPtr CursorLimits;
515 DisplayCursorProcPtr DisplayCursor;
516 RealizeCursorProcPtr RealizeCursor;
517 UnrealizeCursorProcPtr UnrealizeCursor;
518 RecolorCursorProcPtr RecolorCursor;
519 SetCursorPositionProcPtr SetCursorPosition;
520
521 /* GC procedures */
522
523 CreateGCProcPtr CreateGC;
524
525 /* Colormap procedures */
526
527 CreateColormapProcPtr CreateColormap;
528 DestroyColormapProcPtr DestroyColormap;
529 InstallColormapProcPtr InstallColormap;
530 UninstallColormapProcPtr UninstallColormap;
531 ListInstalledColormapsProcPtr ListInstalledColormaps;
532 StoreColorsProcPtr StoreColors;
533 ResolveColorProcPtr ResolveColor;
534
535 /* Region procedures */
536
537 BitmapToRegionProcPtr BitmapToRegion;
538 SendGraphicsExposeProcPtr SendGraphicsExpose;
539
540 /* os layer procedures */
541
542 ScreenBlockHandlerProcPtr BlockHandler;
543 ScreenWakeupHandlerProcPtr WakeupHandler;
544
545 pointer blockData;
546 pointer wakeupData;
547
548 /* anybody can get a piece of this array */
549 DevUnion *devPrivates;
550
551 CreateScreenResourcesProcPtr CreateScreenResources;
552 ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
553
554 GetWindowPixmapProcPtr GetWindowPixmap;
555 SetWindowPixmapProcPtr SetWindowPixmap;
556 GetScreenPixmapProcPtr GetScreenPixmap;
557 SetScreenPixmapProcPtr SetScreenPixmap;
558
559 PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
560
561 int PixmapPrivateLen;
562 unsigned int *PixmapPrivateSizes;
563 unsigned int totalPixmapSize;
564
565 MarkWindowProcPtr MarkWindow;
566 MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
567 ChangeSaveUnderProcPtr ChangeSaveUnder;
568 PostChangeSaveUnderProcPtr PostChangeSaveUnder;
569 MoveWindowProcPtr MoveWindow;
570 ResizeWindowProcPtr ResizeWindow;
571 GetLayerWindowProcPtr GetLayerWindow;
572 HandleExposuresProcPtr HandleExposures;
573 ReparentWindowProcPtr ReparentWindow;
574
575#ifdef SHAPE
576 SetShapeProcPtr SetShape;
577#endif /* SHAPE */
578
579 ChangeBorderWidthProcPtr ChangeBorderWidth;
580 MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
581
582} ScreenRec;
583
584typedef struct _ScreenInfo {
585 int imageByteOrder;
586 int bitmapScanlineUnit;
587 int bitmapScanlinePad;
588 int bitmapBitOrder;
589 int numPixmapFormats;
590 PixmapFormatRec
591 formats[MAXFORMATS];
592 int arraySize;
593 int numScreens;
594 ScreenPtr screens[MAXSCREENS];
595 int numVideoScreens;
596} ScreenInfo;
597
598extern ScreenInfo screenInfo;
599
600extern void InitOutput(
601 ScreenInfo * /*pScreenInfo*/,
602 int /*argc*/,
603 char ** /*argv*/);
604
605#endif /* SCREENINTSTRUCT_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette