1 /***********************************************************
3 Copyright 1987, 1998 The Open Group
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
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
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.
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.
26 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
30 Permission to use, copy, modify, and distribute this software and its
31 documentation for any purpose and without fee is hereby granted,
32 provided that the above copyright notice appear in all copies and that
33 both that copyright notice and this permission notice appear in
34 supporting documentation, and that the name of Digital not be
35 used in advertising or publicity pertaining to distribution of the
36 software without specific, written prior permission.
38 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46 ******************************************************************/
48 #ifndef SCREENINTSTRUCT_H
49 #define SCREENINTSTRUCT_H
51 #include "screenint.h"
52 #include "regionstr.h"
57 #include <X11/Xproto.h>
60 typedef struct _PixmapFormat
{
62 unsigned char bitsPerPixel
;
63 unsigned char scanlinePad
;
66 typedef struct _Visual
{
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
;
78 typedef struct _Depth
{
81 VisualID
*vids
; /* block of visual ids for this depth */
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.
91 typedef Bool (* CloseScreenProcPtr
)(
93 ScreenPtr
/*pScreen*/);
95 typedef void (* QueryBestSizeProcPtr
)(
97 unsigned short * /*pwidth*/,
98 unsigned short * /*pheight*/,
99 ScreenPtr
/*pScreen*/);
101 typedef Bool (* SaveScreenProcPtr
)(
102 ScreenPtr
/*pScreen*/,
105 typedef void (* GetImageProcPtr
)(
106 DrawablePtr
/*pDrawable*/,
111 unsigned int /*format*/,
112 unsigned long /*planeMask*/,
113 char * /*pdstLine*/);
115 typedef void (* GetSpansProcPtr
)(
116 DrawablePtr
/*pDrawable*/,
121 char * /*pdstStart*/);
123 typedef void (* PointerNonInterestBoxProcPtr
)(
124 ScreenPtr
/*pScreen*/,
127 typedef void (* SourceValidateProcPtr
)(
128 DrawablePtr
/*pDrawable*/,
134 typedef Bool (* CreateWindowProcPtr
)(
135 WindowPtr
/*pWindow*/);
137 typedef Bool (* DestroyWindowProcPtr
)(
138 WindowPtr
/*pWindow*/);
140 typedef Bool (* PositionWindowProcPtr
)(
141 WindowPtr
/*pWindow*/,
145 typedef Bool (* ChangeWindowAttributesProcPtr
)(
146 WindowPtr
/*pWindow*/,
147 unsigned long /*mask*/);
149 typedef Bool (* RealizeWindowProcPtr
)(
150 WindowPtr
/*pWindow*/);
152 typedef Bool (* UnrealizeWindowProcPtr
)(
153 WindowPtr
/*pWindow*/);
155 typedef void (* RestackWindowProcPtr
)(
156 WindowPtr
/*pWindow*/,
157 WindowPtr
/*pOldNextSib*/);
159 typedef int (* ValidateTreeProcPtr
)(
160 WindowPtr
/*pParent*/,
161 WindowPtr
/*pChild*/,
164 typedef void (* PostValidateTreeProcPtr
)(
165 WindowPtr
/*pParent*/,
166 WindowPtr
/*pChild*/,
169 typedef void (* WindowExposuresProcPtr
)(
170 WindowPtr
/*pWindow*/,
172 RegionPtr
/*other_exposed*/);
174 typedef void (* PaintWindowProcPtr
)(
175 WindowPtr
/*pWindow*/,
176 RegionPtr
/*pRegion*/,
179 typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr
;
180 typedef PaintWindowProcPtr PaintWindowBorderProcPtr
;
182 typedef void (* CopyWindowProcPtr
)(
183 WindowPtr
/*pWindow*/,
184 DDXPointRec
/*ptOldOrg*/,
185 RegionPtr
/*prgnSrc*/);
187 typedef void (* ClearToBackgroundProcPtr
)(
188 WindowPtr
/*pWindow*/,
193 Bool
/*generateExposures*/);
195 typedef void (* ClipNotifyProcPtr
)(
196 WindowPtr
/*pWindow*/,
200 typedef PixmapPtr (* CreatePixmapProcPtr
)(
201 ScreenPtr
/*pScreen*/,
206 typedef Bool (* DestroyPixmapProcPtr
)(
207 PixmapPtr
/*pPixmap*/);
209 typedef void (* SaveDoomedAreasProcPtr
)(
210 WindowPtr
/*pWindow*/,
211 RegionPtr
/*prgnSave*/,
215 typedef RegionPtr (* RestoreAreasProcPtr
)(
216 WindowPtr
/*pWindow*/,
217 RegionPtr
/*prgnRestore*/);
219 typedef void (* ExposeCopyProcPtr
)(
221 DrawablePtr
/*pDst*/,
223 RegionPtr
/*prgnExposed*/,
228 unsigned long /*plane*/);
230 typedef RegionPtr (* TranslateBackingStoreProcPtr
)(
231 WindowPtr
/*pWindow*/,
234 RegionPtr
/*oldClip*/,
238 typedef RegionPtr (* ClearBackingStoreProcPtr
)(
239 WindowPtr
/*pWindow*/,
244 Bool
/*generateExposures*/);
246 typedef void (* DrawGuaranteeProcPtr
)(
247 WindowPtr
/*pWindow*/,
251 typedef Bool (* RealizeFontProcPtr
)(
252 ScreenPtr
/*pScreen*/,
255 typedef Bool (* UnrealizeFontProcPtr
)(
256 ScreenPtr
/*pScreen*/,
259 typedef void (* ConstrainCursorProcPtr
)(
260 ScreenPtr
/*pScreen*/,
263 typedef void (* CursorLimitsProcPtr
)(
264 ScreenPtr
/*pScreen*/,
265 CursorPtr
/*pCursor*/,
267 BoxPtr
/*pTopLeftBox*/);
269 typedef Bool (* DisplayCursorProcPtr
)(
270 ScreenPtr
/*pScreen*/,
271 CursorPtr
/*pCursor*/);
273 typedef Bool (* RealizeCursorProcPtr
)(
274 ScreenPtr
/*pScreen*/,
275 CursorPtr
/*pCursor*/);
277 typedef Bool (* UnrealizeCursorProcPtr
)(
278 ScreenPtr
/*pScreen*/,
279 CursorPtr
/*pCursor*/);
281 typedef void (* RecolorCursorProcPtr
)(
282 ScreenPtr
/*pScreen*/,
283 CursorPtr
/*pCursor*/,
286 typedef Bool (* SetCursorPositionProcPtr
)(
287 ScreenPtr
/*pScreen*/,
290 Bool
/*generateEvent*/);
292 typedef Bool (* CreateGCProcPtr
)(
295 typedef Bool (* CreateColormapProcPtr
)(
296 ColormapPtr
/*pColormap*/);
298 typedef void (* DestroyColormapProcPtr
)(
299 ColormapPtr
/*pColormap*/);
301 typedef void (* InstallColormapProcPtr
)(
302 ColormapPtr
/*pColormap*/);
304 typedef void (* UninstallColormapProcPtr
)(
305 ColormapPtr
/*pColormap*/);
307 typedef int (* ListInstalledColormapsProcPtr
) (
308 ScreenPtr
/*pScreen*/,
311 typedef void (* StoreColorsProcPtr
)(
312 ColormapPtr
/*pColormap*/,
314 xColorItem
* /*pdef*/);
316 typedef void (* ResolveColorProcPtr
)(
317 unsigned short* /*pred*/,
318 unsigned short* /*pgreen*/,
319 unsigned short* /*pblue*/,
320 VisualPtr
/*pVisual*/);
322 typedef RegionPtr (* BitmapToRegionProcPtr
)(
325 typedef void (* SendGraphicsExposeProcPtr
)(
326 ClientPtr
/*client*/,
332 typedef void (* ScreenBlockHandlerProcPtr
)(
334 pointer
/*blockData*/,
335 pointer
/*pTimeout*/,
336 pointer
/*pReadmask*/);
338 typedef void (* ScreenWakeupHandlerProcPtr
)(
340 pointer
/*wakeupData*/,
341 unsigned long /*result*/,
342 pointer
/*pReadMask*/);
344 typedef Bool (* CreateScreenResourcesProcPtr
)(
345 ScreenPtr
/*pScreen*/);
347 typedef Bool (* ModifyPixmapHeaderProcPtr
)(
348 PixmapPtr
/*pPixmap*/,
352 int /*bitsPerPixel*/,
354 pointer
/*pPixData*/);
356 typedef PixmapPtr (* GetWindowPixmapProcPtr
)(
359 typedef void (* SetWindowPixmapProcPtr
)(
363 typedef PixmapPtr (* GetScreenPixmapProcPtr
)(
364 ScreenPtr
/*pScreen*/);
366 typedef void (* SetScreenPixmapProcPtr
)(
369 typedef void (* MarkWindowProcPtr
)(
372 typedef Bool (* MarkOverlappedWindowsProcPtr
)(
373 WindowPtr
/*parent*/,
374 WindowPtr
/*firstChild*/,
375 WindowPtr
* /*pLayerWin*/);
377 typedef Bool (* ChangeSaveUnderProcPtr
)(
378 WindowPtr
/*pLayerWin*/,
379 WindowPtr
/*firstChild*/);
381 typedef void (* PostChangeSaveUnderProcPtr
)(
382 WindowPtr
/*pLayerWin*/,
383 WindowPtr
/*firstChild*/);
385 typedef void (* MoveWindowProcPtr
)(
392 typedef void (* ResizeWindowProcPtr
)(
401 typedef WindowPtr (* GetLayerWindowProcPtr
)(
405 typedef void (* HandleExposuresProcPtr
)(
408 typedef void (* ReparentWindowProcPtr
)(
410 WindowPtr
/*pPriorParent*/);
413 typedef void (* SetShapeProcPtr
)(
417 typedef void (* ChangeBorderWidthProcPtr
)(
419 unsigned int /*width*/);
421 typedef void (* MarkUnrealizedWindowProcPtr
)(
422 WindowPtr
/*pChild*/,
424 Bool
/*fromConfigure*/);
426 typedef struct _Screen
{
427 int myNum
; /* index of this instance in Screens[] */
430 short mmWidth
, mmHeight
;
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
448 PixmapPtr PixmapPerDepth
[1];
452 int WindowPrivateLen
;
453 unsigned *WindowPrivateSizes
;
454 unsigned totalWindowSize
;
456 unsigned *GCPrivateSizes
;
457 unsigned totalGCSize
;
459 /* Random screen procedures */
461 CloseScreenProcPtr CloseScreen
;
462 QueryBestSizeProcPtr QueryBestSize
;
463 SaveScreenProcPtr SaveScreen
;
464 GetImageProcPtr GetImage
;
465 GetSpansProcPtr GetSpans
;
466 PointerNonInterestBoxProcPtr PointerNonInterestBox
;
467 SourceValidateProcPtr SourceValidate
;
469 /* Window Procedures */
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
;
487 /* Pixmap procedures */
489 CreatePixmapProcPtr CreatePixmap
;
490 DestroyPixmapProcPtr DestroyPixmap
;
492 /* Backing store procedures */
494 SaveDoomedAreasProcPtr SaveDoomedAreas
;
495 RestoreAreasProcPtr RestoreAreas
;
496 ExposeCopyProcPtr ExposeCopy
;
497 TranslateBackingStoreProcPtr TranslateBackingStore
;
498 ClearBackingStoreProcPtr ClearBackingStore
;
499 DrawGuaranteeProcPtr DrawGuarantee
;
501 * A read/write copy of the lower level backing store vector is needed now
502 * that the functions can be wrapped.
504 BSFuncRec BackingStoreFuncs
;
506 /* Font procedures */
508 RealizeFontProcPtr RealizeFont
;
509 UnrealizeFontProcPtr UnrealizeFont
;
511 /* Cursor Procedures */
513 ConstrainCursorProcPtr ConstrainCursor
;
514 CursorLimitsProcPtr CursorLimits
;
515 DisplayCursorProcPtr DisplayCursor
;
516 RealizeCursorProcPtr RealizeCursor
;
517 UnrealizeCursorProcPtr UnrealizeCursor
;
518 RecolorCursorProcPtr RecolorCursor
;
519 SetCursorPositionProcPtr SetCursorPosition
;
523 CreateGCProcPtr CreateGC
;
525 /* Colormap procedures */
527 CreateColormapProcPtr CreateColormap
;
528 DestroyColormapProcPtr DestroyColormap
;
529 InstallColormapProcPtr InstallColormap
;
530 UninstallColormapProcPtr UninstallColormap
;
531 ListInstalledColormapsProcPtr ListInstalledColormaps
;
532 StoreColorsProcPtr StoreColors
;
533 ResolveColorProcPtr ResolveColor
;
535 /* Region procedures */
537 BitmapToRegionProcPtr BitmapToRegion
;
538 SendGraphicsExposeProcPtr SendGraphicsExpose
;
540 /* os layer procedures */
542 ScreenBlockHandlerProcPtr BlockHandler
;
543 ScreenWakeupHandlerProcPtr WakeupHandler
;
548 /* anybody can get a piece of this array */
549 DevUnion
*devPrivates
;
551 CreateScreenResourcesProcPtr CreateScreenResources
;
552 ModifyPixmapHeaderProcPtr ModifyPixmapHeader
;
554 GetWindowPixmapProcPtr GetWindowPixmap
;
555 SetWindowPixmapProcPtr SetWindowPixmap
;
556 GetScreenPixmapProcPtr GetScreenPixmap
;
557 SetScreenPixmapProcPtr SetScreenPixmap
;
559 PixmapPtr pScratchPixmap
; /* scratch pixmap "pool" */
561 int PixmapPrivateLen
;
562 unsigned int *PixmapPrivateSizes
;
563 unsigned int totalPixmapSize
;
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
;
576 SetShapeProcPtr SetShape
;
579 ChangeBorderWidthProcPtr ChangeBorderWidth
;
580 MarkUnrealizedWindowProcPtr MarkUnrealizedWindow
;
584 typedef struct _ScreenInfo
{
586 int bitmapScanlineUnit
;
587 int bitmapScanlinePad
;
589 int numPixmapFormats
;
594 ScreenPtr screens
[MAXSCREENS
];
598 extern ScreenInfo screenInfo
;
600 extern void InitOutput(
601 ScreenInfo
* /*pScreenInfo*/,
605 #endif /* SCREENINTSTRUCT_H */