VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.5.3/scrnintstr.h@ 77138

Last change on this file since 77138 was 17471, checked in by vboxsync, 16 years ago

export to OSE

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