1 /* $XConsortium: scrnintstr.h /main/32 1996/09/28 17:14:32 rws $ */
2 /***********************************************************
4 Copyright (c) 1987 X Consortium
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 Except as contained in this notice, the name of the X Consortium shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from the X Consortium.
28 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
32 Permission to use, copy, modify, and distribute this software and its
33 documentation for any purpose and without fee is hereby granted,
34 provided that the above copyright notice appear in all copies and that
35 both that copyright notice and this permission notice appear in
36 supporting documentation, and that the name of Digital not be
37 used in advertising or publicity pertaining to distribution of the
38 software without specific, written prior permission.
40 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
48 ******************************************************************/
49 #ifndef SCREENINTSTRUCT_H
50 #define SCREENINTSTRUCT_H
52 #include "screenint.h"
53 #include "miscstruct.h"
61 #include "X11/Xproto.h"
64 typedef struct _PixmapFormat {
66 unsigned char bitsPerPixel;
67 unsigned char scanlinePad;
70 typedef struct _Visual {
72 #if defined(__cplusplus) || defined(c_plusplus)
77 short bitsPerRGBValue;
78 short ColormapEntries;
79 short nplanes;/* = log2 (ColormapEntries). This does not
80 * imply that the screen has this many planes.
81 * it may have more or fewer */
82 unsigned long redMask, greenMask, blueMask;
83 int offsetRed, offsetGreen, offsetBlue;
86 typedef struct _Depth {
89 VisualID *vids; /* block of visual ids for this depth */
94 * There is a typedef for each screen function pointer so that code that
95 * needs to declare a screen function pointer (e.g. in a screen private
96 * or as a local variable) can easily do so and retain full type checking.
99 typedef Bool (* CloseScreenProcPtr)(
100 #if NeedNestedPrototypes
102 ScreenPtr /*pScreen*/
106 typedef void (* QueryBestSizeProcPtr)(
107 #if NeedNestedPrototypes
109 unsigned short * /*pwidth*/,
110 unsigned short * /*pheight*/,
111 ScreenPtr /*pScreen*/
115 typedef Bool (* SaveScreenProcPtr)(
116 #if NeedNestedPrototypes
117 ScreenPtr /*pScreen*/,
122 typedef void (* GetImageProcPtr)(
123 #if NeedNestedPrototypes
124 DrawablePtr /*pDrawable*/,
129 unsigned int /*format*/,
130 unsigned long /*planeMask*/,
135 typedef void (* GetSpansProcPtr)(
136 #if NeedNestedPrototypes
137 DrawablePtr /*pDrawable*/,
146 typedef void (* PointerNonInterestBoxProcPtr)(
147 #if NeedNestedPrototypes
148 ScreenPtr /*pScreen*/,
153 typedef void (* SourceValidateProcPtr)(
154 #if NeedNestedPrototypes
155 DrawablePtr /*pDrawable*/,
163 typedef Bool (* CreateWindowProcPtr)(
164 #if NeedNestedPrototypes
165 WindowPtr /*pWindow*/
169 typedef Bool (* DestroyWindowProcPtr)(
170 #if NeedNestedPrototypes
171 WindowPtr /*pWindow*/
175 typedef Bool (* PositionWindowProcPtr)(
176 #if NeedNestedPrototypes
177 WindowPtr /*pWindow*/,
183 typedef Bool (* ChangeWindowAttributesProcPtr)(
184 #if NeedNestedPrototypes
185 WindowPtr /*pWindow*/,
186 unsigned long /*mask*/
190 typedef Bool (* RealizeWindowProcPtr)(
191 #if NeedNestedPrototypes
192 WindowPtr /*pWindow*/
196 typedef Bool (* UnrealizeWindowProcPtr)(
197 #if NeedNestedPrototypes
198 WindowPtr /*pWindow*/
202 typedef int (* ValidateTreeProcPtr)(
203 #if NeedNestedPrototypes
204 WindowPtr /*pParent*/,
205 WindowPtr /*pChild*/,
210 typedef void (* PostValidateTreeProcPtr)(
211 #if NeedNestedPrototypes
212 WindowPtr /*pParent*/,
213 WindowPtr /*pChild*/,
218 typedef void (* WindowExposuresProcPtr)(
219 #if NeedNestedPrototypes
220 WindowPtr /*pWindow*/,
222 RegionPtr /*other_exposed*/
226 typedef void (* PaintWindowBackgroundProcPtr)(
227 #if NeedNestedPrototypes
228 WindowPtr /*pWindow*/,
229 RegionPtr /*pRegion*/,
234 typedef void (* PaintWindowBorderProcPtr)(
235 #if NeedNestedPrototypes
236 WindowPtr /*pWindow*/,
237 RegionPtr /*pRegion*/,
242 typedef void (* CopyWindowProcPtr)(
243 #if NeedNestedPrototypes
244 WindowPtr /*pWindow*/,
245 DDXPointRec /*ptOldOrg*/,
246 RegionPtr /*prgnSrc*/
250 typedef void (* ClearToBackgroundProcPtr)(
251 #if NeedNestedPrototypes
252 WindowPtr /*pWindow*/,
257 Bool /*generateExposures*/
261 typedef void (* ClipNotifyProcPtr)(
262 #if NeedNestedPrototypes
263 WindowPtr /*pWindow*/,
269 typedef PixmapPtr (* CreatePixmapProcPtr)(
270 #if NeedNestedPrototypes
271 ScreenPtr /*pScreen*/,
278 typedef Bool (* DestroyPixmapProcPtr)(
279 #if NeedNestedPrototypes
280 PixmapPtr /*pPixmap*/
284 typedef void (* SaveDoomedAreasProcPtr)(
285 #if NeedNestedPrototypes
286 WindowPtr /*pWindow*/,
287 RegionPtr /*prgnSave*/,
293 typedef RegionPtr (* RestoreAreasProcPtr)(
294 #if NeedNestedPrototypes
295 WindowPtr /*pWindow*/,
296 RegionPtr /*prgnRestore*/
300 typedef void (* ExposeCopyProcPtr)(
301 #if NeedNestedPrototypes
303 DrawablePtr /*pDst*/,
305 RegionPtr /*prgnExposed*/,
310 unsigned long /*plane*/
314 typedef RegionPtr (* TranslateBackingStoreProcPtr)(
315 #if NeedNestedPrototypes
316 WindowPtr /*pWindow*/,
319 RegionPtr /*oldClip*/,
325 typedef RegionPtr (* ClearBackingStoreProcPtr)(
326 #if NeedNestedPrototypes
327 WindowPtr /*pWindow*/,
332 Bool /*generateExposures*/
336 typedef void (* DrawGuaranteeProcPtr)(
337 #if NeedNestedPrototypes
338 WindowPtr /*pWindow*/,
344 typedef Bool (* RealizeFontProcPtr)(
345 #if NeedNestedPrototypes
346 ScreenPtr /*pScreen*/,
351 typedef Bool (* UnrealizeFontProcPtr)(
352 #if NeedNestedPrototypes
353 ScreenPtr /*pScreen*/,
358 typedef void (* ConstrainCursorProcPtr)(
359 #if NeedNestedPrototypes
360 ScreenPtr /*pScreen*/,
365 typedef void (* CursorLimitsProcPtr)(
366 #if NeedNestedPrototypes
367 ScreenPtr /*pScreen*/,
368 CursorPtr /*pCursor*/,
370 BoxPtr /*pTopLeftBox*/
374 typedef Bool (* DisplayCursorProcPtr)(
375 #if NeedNestedPrototypes
376 ScreenPtr /*pScreen*/,
377 CursorPtr /*pCursor*/
381 typedef Bool (* RealizeCursorProcPtr)(
382 #if NeedNestedPrototypes
383 ScreenPtr /*pScreen*/,
384 CursorPtr /*pCursor*/
388 typedef Bool (* UnrealizeCursorProcPtr)(
389 #if NeedNestedPrototypes
390 ScreenPtr /*pScreen*/,
391 CursorPtr /*pCursor*/
395 typedef void (* RecolorCursorProcPtr)(
396 #if NeedNestedPrototypes
397 ScreenPtr /*pScreen*/,
398 CursorPtr /*pCursor*/,
403 typedef Bool (* SetCursorPositionProcPtr)(
404 #if NeedNestedPrototypes
405 ScreenPtr /*pScreen*/,
408 Bool /*generateEvent*/
412 typedef Bool (* CreateGCProcPtr)(
413 #if NeedNestedPrototypes
418 typedef Bool (* CreateColormapProcPtr)(
419 #if NeedNestedPrototypes
420 ColormapPtr /*pColormap*/
424 typedef void (* DestroyColormapProcPtr)(
425 #if NeedNestedPrototypes
426 ColormapPtr /*pColormap*/
430 typedef void (* InstallColormapProcPtr)(
431 #if NeedNestedPrototypes
432 ColormapPtr /*pColormap*/
436 typedef void (* UninstallColormapProcPtr)(
437 #if NeedNestedPrototypes
438 ColormapPtr /*pColormap*/
442 typedef int (* ListInstalledColormapsProcPtr) (
443 #if NeedNestedPrototypes
444 ScreenPtr /*pScreen*/,
449 typedef void (* StoreColorsProcPtr)(
450 #if NeedNestedPrototypes
451 ColormapPtr /*pColormap*/,
453 xColorItem * /*pdef*/
457 typedef void (* ResolveColorProcPtr)(
458 #if NeedNestedPrototypes
459 unsigned short* /*pred*/,
460 unsigned short* /*pgreen*/,
461 unsigned short* /*pblue*/,
462 VisualPtr /*pVisual*/
466 typedef RegionPtr (* RegionCreateProcPtr)(
467 #if NeedNestedPrototypes
473 typedef void (* RegionInitProcPtr)(
474 #if NeedNestedPrototypes
481 typedef Bool (* RegionCopyProcPtr)(
482 #if NeedNestedPrototypes
488 typedef void (* RegionDestroyProcPtr)(
489 #if NeedNestedPrototypes
494 typedef void (* RegionUninitProcPtr)(
495 #if NeedNestedPrototypes
500 typedef Bool (* IntersectProcPtr)(
501 #if NeedNestedPrototypes
502 RegionPtr /*newReg*/,
508 typedef Bool (* UnionProcPtr)(
509 #if NeedNestedPrototypes
510 RegionPtr /*newReg*/,
516 typedef Bool (* SubtractProcPtr)(
517 #if NeedNestedPrototypes
524 typedef Bool (* InverseProcPtr)(
525 #if NeedNestedPrototypes
526 RegionPtr /*newReg*/,
532 typedef void (* RegionResetProcPtr)(
533 #if NeedNestedPrototypes
539 typedef void (* TranslateRegionProcPtr)(
540 #if NeedNestedPrototypes
547 typedef int (* RectInProcPtr)(
548 #if NeedNestedPrototypes
549 RegionPtr /*region*/,
554 typedef Bool (* PointInRegionProcPtr)(
555 #if NeedNestedPrototypes
563 typedef Bool (* RegionNotEmptyProcPtr)(
564 #if NeedNestedPrototypes
569 typedef void (* RegionEmptyProcPtr)(
570 #if NeedNestedPrototypes
575 typedef BoxPtr (* RegionExtentsProcPtr)(
576 #if NeedNestedPrototypes
581 typedef Bool (* RegionAppendProcPtr)(
582 #if NeedNestedPrototypes
583 RegionPtr /*dstrgn*/,
588 typedef Bool (* RegionValidateProcPtr)(
589 #if NeedNestedPrototypes
590 RegionPtr /*badreg*/,
595 typedef RegionPtr (* BitmapToRegionProcPtr)(
596 #if NeedNestedPrototypes
601 typedef RegionPtr (* RectsToRegionProcPtr)(
602 #if NeedNestedPrototypes
604 xRectangle* /*prect*/,
609 typedef void (* SendGraphicsExposeProcPtr)(
610 #if NeedNestedPrototypes
611 ClientPtr /*client*/,
619 typedef void (* ScreenBlockHandlerProcPtr)(
620 #if NeedNestedPrototypes
622 pointer /*blockData*/,
623 struct timeval ** /*pTimeout*/,
624 pointer /*pReadmask*/
628 typedef void (* ScreenWakeupHandlerProcPtr)(
629 #if NeedNestedPrototypes
631 pointer /*wakeupData*/,
632 unsigned long /*result*/,
633 pointer /*pReadMask*/
637 typedef Bool (* CreateScreenResourcesProcPtr)(
638 #if NeedNestedPrototypes
639 ScreenPtr /*pScreen*/
643 typedef Bool (* ModifyPixmapHeaderProcPtr)(
644 #if NeedNestedPrototypes
645 PixmapPtr /*pPixmap*/,
649 int /*bitsPerPixel*/,
655 typedef void (* MarkWindowProcPtr)(
656 #if NeedNestedPrototypes
661 typedef Bool (* MarkOverlappedWindowsProcPtr)(
662 #if NeedNestedPrototypes
663 WindowPtr /*parent*/,
664 WindowPtr /*firstChild*/,
665 WindowPtr * /*pLayerWin*/
669 typedef Bool (* ChangeSaveUnderProcPtr)(
670 #if NeedNestedPrototypes
671 WindowPtr /*pLayerWin*/,
672 WindowPtr /*firstChild*/
676 typedef void (* PostChangeSaveUnderProcPtr)(
677 #if NeedNestedPrototypes
678 WindowPtr /*pLayerWin*/,
679 WindowPtr /*firstChild*/
683 typedef void (* MoveWindowProcPtr)(
684 #if NeedNestedPrototypes
693 typedef void (* ResizeWindowProcPtr)(
694 #if NeedNestedPrototypes
704 typedef WindowPtr (* GetLayerWindowProcPtr)(
705 #if NeedNestedPrototypes
710 typedef void (* HandleExposuresProcPtr)(
711 #if NeedNestedPrototypes
716 typedef void (* ReparentWindowProcPtr)(
717 #if NeedNestedPrototypes
719 WindowPtr /*pPriorParent*/
724 typedef void (* SetShapeProcPtr)(
725 #if NeedFunctionPrototypes
731 typedef void (* ChangeBorderWidthProcPtr)(
732 #if NeedFunctionPrototypes
734 unsigned int /*width*/
738 typedef void (* MarkUnrealizedWindowProcPtr)(
739 #if NeedFunctionPrototypes
740 WindowPtr /*pChild*/,
742 Bool /*fromConfigure*/
746 typedef struct _Screen {
747 int myNum; /* index of this instance in Screens[] */
750 short mmWidth, mmHeight;
752 unsigned char rootDepth;
753 DepthPtr allowedDepths;
754 unsigned long rootVisual;
755 unsigned long defColormap;
756 short minInstalledCmaps, maxInstalledCmaps;
757 char backingStoreSupport, saveUnderSupport;
758 unsigned long whitePixel, blackPixel;
759 unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
760 GCPtr GCperDepth[MAXFORMATS+1];
761 /* next field is a stipple to use as default in
762 a GC. we don't build default tiles of all depths
763 because they are likely to be of a color
764 different from the default fg pixel, so
765 we don't win anything by building
768 PixmapPtr PixmapPerDepth[1];
772 int WindowPrivateLen;
773 unsigned *WindowPrivateSizes;
774 unsigned totalWindowSize;
776 unsigned *GCPrivateSizes;
777 unsigned totalGCSize;
779 /* Random screen procedures */
781 CloseScreenProcPtr CloseScreen;
782 QueryBestSizeProcPtr QueryBestSize;
783 SaveScreenProcPtr SaveScreen;
784 GetImageProcPtr GetImage;
785 GetSpansProcPtr GetSpans;
786 PointerNonInterestBoxProcPtr PointerNonInterestBox;
787 SourceValidateProcPtr SourceValidate;
789 /* Window Procedures */
791 CreateWindowProcPtr CreateWindow;
792 DestroyWindowProcPtr DestroyWindow;
793 PositionWindowProcPtr PositionWindow;
794 ChangeWindowAttributesProcPtr ChangeWindowAttributes;
795 RealizeWindowProcPtr RealizeWindow;
796 UnrealizeWindowProcPtr UnrealizeWindow;
797 ValidateTreeProcPtr ValidateTree;
798 PostValidateTreeProcPtr PostValidateTree;
799 WindowExposuresProcPtr WindowExposures;
800 PaintWindowBackgroundProcPtr PaintWindowBackground;
801 PaintWindowBorderProcPtr PaintWindowBorder;
802 CopyWindowProcPtr CopyWindow;
803 ClearToBackgroundProcPtr ClearToBackground;
804 ClipNotifyProcPtr ClipNotify;
806 /* Pixmap procedures */
808 CreatePixmapProcPtr CreatePixmap;
809 DestroyPixmapProcPtr DestroyPixmap;
811 /* Backing store procedures */
813 SaveDoomedAreasProcPtr SaveDoomedAreas;
814 RestoreAreasProcPtr RestoreAreas;
815 ExposeCopyProcPtr ExposeCopy;
816 TranslateBackingStoreProcPtr TranslateBackingStore;
817 ClearBackingStoreProcPtr ClearBackingStore;
818 DrawGuaranteeProcPtr DrawGuarantee;
820 /* Font procedures */
822 RealizeFontProcPtr RealizeFont;
823 UnrealizeFontProcPtr UnrealizeFont;
825 /* Cursor Procedures */
827 ConstrainCursorProcPtr ConstrainCursor;
828 CursorLimitsProcPtr CursorLimits;
829 DisplayCursorProcPtr DisplayCursor;
830 RealizeCursorProcPtr RealizeCursor;
831 UnrealizeCursorProcPtr UnrealizeCursor;
832 RecolorCursorProcPtr RecolorCursor;
833 SetCursorPositionProcPtr SetCursorPosition;
837 CreateGCProcPtr CreateGC;
839 /* Colormap procedures */
841 CreateColormapProcPtr CreateColormap;
842 DestroyColormapProcPtr DestroyColormap;
843 InstallColormapProcPtr InstallColormap;
844 UninstallColormapProcPtr UninstallColormap;
845 ListInstalledColormapsProcPtr ListInstalledColormaps;
846 StoreColorsProcPtr StoreColors;
847 ResolveColorProcPtr ResolveColor;
849 /* Region procedures */
851 RegionCreateProcPtr RegionCreate;
852 RegionInitProcPtr RegionInit;
853 RegionCopyProcPtr RegionCopy;
854 RegionDestroyProcPtr RegionDestroy;
855 RegionUninitProcPtr RegionUninit;
856 IntersectProcPtr Intersect;
858 SubtractProcPtr Subtract;
859 InverseProcPtr Inverse;
860 RegionResetProcPtr RegionReset;
861 TranslateRegionProcPtr TranslateRegion;
862 RectInProcPtr RectIn;
863 PointInRegionProcPtr PointInRegion;
864 RegionNotEmptyProcPtr RegionNotEmpty;
865 RegionEmptyProcPtr RegionEmpty;
866 RegionExtentsProcPtr RegionExtents;
867 RegionAppendProcPtr RegionAppend;
868 RegionValidateProcPtr RegionValidate;
869 BitmapToRegionProcPtr BitmapToRegion;
870 RectsToRegionProcPtr RectsToRegion;
871 SendGraphicsExposeProcPtr SendGraphicsExpose;
873 /* os layer procedures */
875 ScreenBlockHandlerProcPtr BlockHandler;
876 ScreenWakeupHandlerProcPtr WakeupHandler;
881 /* anybody can get a piece of this array */
882 DevUnion *devPrivates;
884 CreateScreenResourcesProcPtr CreateScreenResources;
885 ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
887 PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
890 int PixmapPrivateLen;
891 unsigned *PixmapPrivateSizes;
892 unsigned totalPixmapSize;
895 MarkWindowProcPtr MarkWindow;
896 MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
897 ChangeSaveUnderProcPtr ChangeSaveUnder;
898 PostChangeSaveUnderProcPtr PostChangeSaveUnder;
899 MoveWindowProcPtr MoveWindow;
900 ResizeWindowProcPtr ResizeWindow;
901 GetLayerWindowProcPtr GetLayerWindow;
902 HandleExposuresProcPtr HandleExposures;
903 ReparentWindowProcPtr ReparentWindow;
906 SetShapeProcPtr SetShape;
909 ChangeBorderWidthProcPtr ChangeBorderWidth;
910 MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
914 typedef struct _ScreenInfo {
916 int bitmapScanlineUnit;
917 int bitmapScanlinePad;
919 int numPixmapFormats;
924 ScreenPtr screens[MAXSCREENS];
928 extern ScreenInfo screenInfo;
930 extern void InitOutput(
931 #if NeedFunctionPrototypes
932 ScreenInfo * /*pScreenInfo*/,
938 #endif /* SCREENINTSTRUCT_H */