1
/* $Xorg: scrnintstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
2
/***********************************************************
4
Copyright 1987, 1998 The Open Group
6
Permission to use, copy, modify, distribute, and sell this software and its
7
documentation for any purpose is hereby granted without fee, provided that
8
the above copyright notice appear in all copies and that both that
9
copyright notice and this permission notice appear in supporting
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
Except as contained in this notice, the name of The Open Group shall not be
23
used in advertising or otherwise to promote the sale, use or other dealings
24
in this Software without prior written authorization from The Open Group.
27
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
31
Permission to use, copy, modify, and distribute this software and its
32
documentation for any purpose and without fee is hereby granted,
33
provided that the above copyright notice appear in all copies and that
34
both that copyright notice and this permission notice appear in
35
supporting documentation, and that the name of Digital not be
36
used in advertising or publicity pertaining to distribution of the
37
software without specific, written prior permission.
39
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47
******************************************************************/
48
/* $XFree86: xc/programs/Xserver/include/scrnintstr.h,v 1.10 2001/12/14 19:59:56 dawes Exp $ */
50
#ifndef SCREENINTSTRUCT_H
51
#define SCREENINTSTRUCT_H
53
#include "screenint.h"
54
#include "miscstruct.h"
59
#include "X11/Xproto.h"
62
typedef struct _PixmapFormat {
64
unsigned char bitsPerPixel;
65
unsigned char scanlinePad;
68
typedef struct _Visual {
71
short bitsPerRGBValue;
72
short ColormapEntries;
73
short nplanes;/* = log2 (ColormapEntries). This does not
74
* imply that the screen has this many planes.
75
* it may have more or fewer */
76
unsigned long redMask, greenMask, blueMask;
77
int offsetRed, offsetGreen, offsetBlue;
80
typedef struct _Depth {
83
VisualID *vids; /* block of visual ids for this depth */
88
* There is a typedef for each screen function pointer so that code that
89
* needs to declare a screen function pointer (e.g. in a screen private
90
* or as a local variable) can easily do so and retain full type checking.
93
typedef Bool (* CloseScreenProcPtr)(
94
#if NeedNestedPrototypes
100
typedef void (* QueryBestSizeProcPtr)(
101
#if NeedNestedPrototypes
103
unsigned short * /*pwidth*/,
104
unsigned short * /*pheight*/,
105
ScreenPtr /*pScreen*/
109
typedef Bool (* SaveScreenProcPtr)(
110
#if NeedNestedPrototypes
111
ScreenPtr /*pScreen*/,
116
typedef void (* GetImageProcPtr)(
117
#if NeedNestedPrototypes
118
DrawablePtr /*pDrawable*/,
123
unsigned int /*format*/,
124
unsigned long /*planeMask*/,
129
typedef void (* GetSpansProcPtr)(
130
#if NeedNestedPrototypes
131
DrawablePtr /*pDrawable*/,
140
typedef void (* PointerNonInterestBoxProcPtr)(
141
#if NeedNestedPrototypes
142
ScreenPtr /*pScreen*/,
147
typedef void (* SourceValidateProcPtr)(
148
#if NeedNestedPrototypes
149
DrawablePtr /*pDrawable*/,
157
typedef Bool (* CreateWindowProcPtr)(
158
#if NeedNestedPrototypes
159
WindowPtr /*pWindow*/
163
typedef Bool (* DestroyWindowProcPtr)(
164
#if NeedNestedPrototypes
165
WindowPtr /*pWindow*/
169
typedef Bool (* PositionWindowProcPtr)(
170
#if NeedNestedPrototypes
171
WindowPtr /*pWindow*/,
177
typedef Bool (* ChangeWindowAttributesProcPtr)(
178
#if NeedNestedPrototypes
179
WindowPtr /*pWindow*/,
180
unsigned long /*mask*/
184
typedef Bool (* RealizeWindowProcPtr)(
185
#if NeedNestedPrototypes
186
WindowPtr /*pWindow*/
190
typedef Bool (* UnrealizeWindowProcPtr)(
191
#if NeedNestedPrototypes
192
WindowPtr /*pWindow*/
196
typedef void (* RestackWindowProcPtr)(
197
#if NeedNestedPrototypes
198
WindowPtr /*pWindow*/,
199
WindowPtr /*pOldNextSib*/
203
typedef int (* ValidateTreeProcPtr)(
204
#if NeedNestedPrototypes
205
WindowPtr /*pParent*/,
206
WindowPtr /*pChild*/,
211
typedef void (* PostValidateTreeProcPtr)(
212
#if NeedNestedPrototypes
213
WindowPtr /*pParent*/,
214
WindowPtr /*pChild*/,
219
typedef void (* WindowExposuresProcPtr)(
220
#if NeedNestedPrototypes
221
WindowPtr /*pWindow*/,
223
RegionPtr /*other_exposed*/
227
typedef void (* PaintWindowProcPtr)(
228
#if NeedNestedPrototypes
229
WindowPtr /*pWindow*/,
230
RegionPtr /*pRegion*/,
235
typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
236
typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
238
typedef void (* CopyWindowProcPtr)(
239
#if NeedNestedPrototypes
240
WindowPtr /*pWindow*/,
241
DDXPointRec /*ptOldOrg*/,
242
RegionPtr /*prgnSrc*/
246
typedef void (* ClearToBackgroundProcPtr)(
247
#if NeedNestedPrototypes
248
WindowPtr /*pWindow*/,
253
Bool /*generateExposures*/
257
typedef void (* ClipNotifyProcPtr)(
258
#if NeedNestedPrototypes
259
WindowPtr /*pWindow*/,
265
typedef PixmapPtr (* CreatePixmapProcPtr)(
266
#if NeedNestedPrototypes
267
ScreenPtr /*pScreen*/,
274
typedef Bool (* DestroyPixmapProcPtr)(
275
#if NeedNestedPrototypes
276
PixmapPtr /*pPixmap*/
280
typedef void (* SaveDoomedAreasProcPtr)(
281
#if NeedNestedPrototypes
282
WindowPtr /*pWindow*/,
283
RegionPtr /*prgnSave*/,
289
typedef RegionPtr (* RestoreAreasProcPtr)(
290
#if NeedNestedPrototypes
291
WindowPtr /*pWindow*/,
292
RegionPtr /*prgnRestore*/
296
typedef void (* ExposeCopyProcPtr)(
297
#if NeedNestedPrototypes
299
DrawablePtr /*pDst*/,
301
RegionPtr /*prgnExposed*/,
306
unsigned long /*plane*/
310
typedef RegionPtr (* TranslateBackingStoreProcPtr)(
311
#if NeedNestedPrototypes
312
WindowPtr /*pWindow*/,
315
RegionPtr /*oldClip*/,
321
typedef RegionPtr (* ClearBackingStoreProcPtr)(
322
#if NeedNestedPrototypes
323
WindowPtr /*pWindow*/,
328
Bool /*generateExposures*/
332
typedef void (* DrawGuaranteeProcPtr)(
333
#if NeedNestedPrototypes
334
WindowPtr /*pWindow*/,
340
typedef Bool (* RealizeFontProcPtr)(
341
#if NeedNestedPrototypes
342
ScreenPtr /*pScreen*/,
347
typedef Bool (* UnrealizeFontProcPtr)(
348
#if NeedNestedPrototypes
349
ScreenPtr /*pScreen*/,
354
typedef void (* ConstrainCursorProcPtr)(
355
#if NeedNestedPrototypes
356
ScreenPtr /*pScreen*/,
361
typedef void (* CursorLimitsProcPtr)(
362
#if NeedNestedPrototypes
363
ScreenPtr /*pScreen*/,
364
CursorPtr /*pCursor*/,
366
BoxPtr /*pTopLeftBox*/
370
typedef Bool (* DisplayCursorProcPtr)(
371
#if NeedNestedPrototypes
372
ScreenPtr /*pScreen*/,
373
CursorPtr /*pCursor*/
377
typedef Bool (* RealizeCursorProcPtr)(
378
#if NeedNestedPrototypes
379
ScreenPtr /*pScreen*/,
380
CursorPtr /*pCursor*/
384
typedef Bool (* UnrealizeCursorProcPtr)(
385
#if NeedNestedPrototypes
386
ScreenPtr /*pScreen*/,
387
CursorPtr /*pCursor*/
391
typedef void (* RecolorCursorProcPtr)(
392
#if NeedNestedPrototypes
393
ScreenPtr /*pScreen*/,
394
CursorPtr /*pCursor*/,
399
typedef Bool (* SetCursorPositionProcPtr)(
400
#if NeedNestedPrototypes
401
ScreenPtr /*pScreen*/,
404
Bool /*generateEvent*/
408
typedef Bool (* CreateGCProcPtr)(
409
#if NeedNestedPrototypes
414
typedef Bool (* CreateColormapProcPtr)(
415
#if NeedNestedPrototypes
416
ColormapPtr /*pColormap*/
420
typedef void (* DestroyColormapProcPtr)(
421
#if NeedNestedPrototypes
422
ColormapPtr /*pColormap*/
426
typedef void (* InstallColormapProcPtr)(
427
#if NeedNestedPrototypes
428
ColormapPtr /*pColormap*/
432
typedef void (* UninstallColormapProcPtr)(
433
#if NeedNestedPrototypes
434
ColormapPtr /*pColormap*/
438
typedef int (* ListInstalledColormapsProcPtr) (
439
#if NeedNestedPrototypes
440
ScreenPtr /*pScreen*/,
445
typedef void (* StoreColorsProcPtr)(
446
#if NeedNestedPrototypes
447
ColormapPtr /*pColormap*/,
449
xColorItem * /*pdef*/
453
typedef void (* ResolveColorProcPtr)(
454
#if NeedNestedPrototypes
455
unsigned short* /*pred*/,
456
unsigned short* /*pgreen*/,
457
unsigned short* /*pblue*/,
458
VisualPtr /*pVisual*/
462
#ifdef NEED_SCREEN_REGIONS
464
typedef RegionPtr (* RegionCreateProcPtr)(
465
#if NeedNestedPrototypes
471
typedef void (* RegionInitProcPtr)(
472
#if NeedNestedPrototypes
479
typedef Bool (* RegionCopyProcPtr)(
480
#if NeedNestedPrototypes
486
typedef void (* RegionDestroyProcPtr)(
487
#if NeedNestedPrototypes
492
typedef void (* RegionUninitProcPtr)(
493
#if NeedNestedPrototypes
498
typedef Bool (* IntersectProcPtr)(
499
#if NeedNestedPrototypes
500
RegionPtr /*newReg*/,
506
typedef Bool (* UnionProcPtr)(
507
#if NeedNestedPrototypes
508
RegionPtr /*newReg*/,
514
typedef Bool (* SubtractProcPtr)(
515
#if NeedNestedPrototypes
522
typedef Bool (* InverseProcPtr)(
523
#if NeedNestedPrototypes
524
RegionPtr /*newReg*/,
530
typedef void (* RegionResetProcPtr)(
531
#if NeedNestedPrototypes
537
typedef void (* TranslateRegionProcPtr)(
538
#if NeedNestedPrototypes
545
typedef int (* RectInProcPtr)(
546
#if NeedNestedPrototypes
547
RegionPtr /*region*/,
552
typedef Bool (* PointInRegionProcPtr)(
553
#if NeedNestedPrototypes
561
typedef Bool (* RegionNotEmptyProcPtr)(
562
#if NeedNestedPrototypes
567
typedef Bool (* RegionBrokenProcPtr)(
568
#if NeedNestedPrototypes
573
typedef Bool (* RegionBreakProcPtr)(
574
#if NeedNestedPrototypes
579
typedef void (* RegionEmptyProcPtr)(
580
#if NeedNestedPrototypes
585
typedef BoxPtr (* RegionExtentsProcPtr)(
586
#if NeedNestedPrototypes
591
typedef Bool (* RegionAppendProcPtr)(
592
#if NeedNestedPrototypes
593
RegionPtr /*dstrgn*/,
598
typedef Bool (* RegionValidateProcPtr)(
599
#if NeedNestedPrototypes
600
RegionPtr /*badreg*/,
605
#endif /* NEED_SCREEN_REGIONS */
607
typedef RegionPtr (* BitmapToRegionProcPtr)(
608
#if NeedNestedPrototypes
613
#ifdef NEED_SCREEN_REGIONS
615
typedef RegionPtr (* RectsToRegionProcPtr)(
616
#if NeedNestedPrototypes
618
xRectangle* /*prect*/,
623
#endif /* NEED_SCREEN_REGIONS */
625
typedef void (* SendGraphicsExposeProcPtr)(
626
#if NeedNestedPrototypes
627
ClientPtr /*client*/,
635
typedef void (* ScreenBlockHandlerProcPtr)(
636
#if NeedNestedPrototypes
638
pointer /*blockData*/,
639
pointer /*pTimeout*/,
640
pointer /*pReadmask*/
644
typedef void (* ScreenWakeupHandlerProcPtr)(
645
#if NeedNestedPrototypes
647
pointer /*wakeupData*/,
648
unsigned long /*result*/,
649
pointer /*pReadMask*/
653
typedef Bool (* CreateScreenResourcesProcPtr)(
654
#if NeedNestedPrototypes
655
ScreenPtr /*pScreen*/
659
typedef Bool (* ModifyPixmapHeaderProcPtr)(
660
#if NeedNestedPrototypes
661
PixmapPtr /*pPixmap*/,
665
int /*bitsPerPixel*/,
671
typedef PixmapPtr (* GetWindowPixmapProcPtr)(
672
#if NeedNestedPrototypes
677
typedef void (* SetWindowPixmapProcPtr)(
678
#if NeedNestedPrototypes
684
typedef PixmapPtr (* GetScreenPixmapProcPtr)(
685
#if NeedNestedPrototypes
686
ScreenPtr /*pScreen*/
690
typedef void (* SetScreenPixmapProcPtr)(
691
#if NeedNestedPrototypes
696
typedef void (* MarkWindowProcPtr)(
697
#if NeedNestedPrototypes
702
typedef Bool (* MarkOverlappedWindowsProcPtr)(
703
#if NeedNestedPrototypes
704
WindowPtr /*parent*/,
705
WindowPtr /*firstChild*/,
706
WindowPtr * /*pLayerWin*/
710
typedef Bool (* ChangeSaveUnderProcPtr)(
711
#if NeedNestedPrototypes
712
WindowPtr /*pLayerWin*/,
713
WindowPtr /*firstChild*/
717
typedef void (* PostChangeSaveUnderProcPtr)(
718
#if NeedNestedPrototypes
719
WindowPtr /*pLayerWin*/,
720
WindowPtr /*firstChild*/
724
typedef void (* MoveWindowProcPtr)(
725
#if NeedNestedPrototypes
734
typedef void (* ResizeWindowProcPtr)(
735
#if NeedNestedPrototypes
745
typedef WindowPtr (* GetLayerWindowProcPtr)(
746
#if NeedNestedPrototypes
751
typedef void (* HandleExposuresProcPtr)(
752
#if NeedNestedPrototypes
757
typedef void (* ReparentWindowProcPtr)(
758
#if NeedNestedPrototypes
760
WindowPtr /*pPriorParent*/
765
typedef void (* SetShapeProcPtr)(
766
#if NeedFunctionPrototypes
772
typedef void (* ChangeBorderWidthProcPtr)(
773
#if NeedFunctionPrototypes
775
unsigned int /*width*/
779
typedef void (* MarkUnrealizedWindowProcPtr)(
780
#if NeedFunctionPrototypes
781
WindowPtr /*pChild*/,
783
Bool /*fromConfigure*/
787
typedef struct _Screen {
788
int myNum; /* index of this instance in Screens[] */
791
short mmWidth, mmHeight;
793
unsigned char rootDepth;
794
DepthPtr allowedDepths;
795
unsigned long rootVisual;
796
unsigned long defColormap;
797
short minInstalledCmaps, maxInstalledCmaps;
798
char backingStoreSupport, saveUnderSupport;
799
unsigned long whitePixel, blackPixel;
800
unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
801
GCPtr GCperDepth[MAXFORMATS+1];
802
/* next field is a stipple to use as default in
803
a GC. we don't build default tiles of all depths
804
because they are likely to be of a color
805
different from the default fg pixel, so
806
we don't win anything by building
809
PixmapPtr PixmapPerDepth[1];
813
int WindowPrivateLen;
814
unsigned *WindowPrivateSizes;
815
unsigned totalWindowSize;
817
unsigned *GCPrivateSizes;
818
unsigned totalGCSize;
820
/* Random screen procedures */
822
CloseScreenProcPtr CloseScreen;
823
QueryBestSizeProcPtr QueryBestSize;
824
SaveScreenProcPtr SaveScreen;
825
GetImageProcPtr GetImage;
826
GetSpansProcPtr GetSpans;
827
PointerNonInterestBoxProcPtr PointerNonInterestBox;
828
SourceValidateProcPtr SourceValidate;
830
/* Window Procedures */
832
CreateWindowProcPtr CreateWindow;
833
DestroyWindowProcPtr DestroyWindow;
834
PositionWindowProcPtr PositionWindow;
835
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
836
RealizeWindowProcPtr RealizeWindow;
837
UnrealizeWindowProcPtr UnrealizeWindow;
838
ValidateTreeProcPtr ValidateTree;
839
PostValidateTreeProcPtr PostValidateTree;
840
WindowExposuresProcPtr WindowExposures;
841
PaintWindowBackgroundProcPtr PaintWindowBackground;
842
PaintWindowBorderProcPtr PaintWindowBorder;
843
CopyWindowProcPtr CopyWindow;
844
ClearToBackgroundProcPtr ClearToBackground;
845
ClipNotifyProcPtr ClipNotify;
846
RestackWindowProcPtr RestackWindow;
848
/* Pixmap procedures */
850
CreatePixmapProcPtr CreatePixmap;
851
DestroyPixmapProcPtr DestroyPixmap;
853
/* Backing store procedures */
855
SaveDoomedAreasProcPtr SaveDoomedAreas;
856
RestoreAreasProcPtr RestoreAreas;
857
ExposeCopyProcPtr ExposeCopy;
858
TranslateBackingStoreProcPtr TranslateBackingStore;
859
ClearBackingStoreProcPtr ClearBackingStore;
860
DrawGuaranteeProcPtr DrawGuarantee;
862
* A read/write copy of the lower level backing store vector is needed now
863
* that the functions can be wrapped.
865
BSFuncRec BackingStoreFuncs;
867
/* Font procedures */
869
RealizeFontProcPtr RealizeFont;
870
UnrealizeFontProcPtr UnrealizeFont;
872
/* Cursor Procedures */
874
ConstrainCursorProcPtr ConstrainCursor;
875
CursorLimitsProcPtr CursorLimits;
876
DisplayCursorProcPtr DisplayCursor;
877
RealizeCursorProcPtr RealizeCursor;
878
UnrealizeCursorProcPtr UnrealizeCursor;
879
RecolorCursorProcPtr RecolorCursor;
880
SetCursorPositionProcPtr SetCursorPosition;
884
CreateGCProcPtr CreateGC;
886
/* Colormap procedures */
888
CreateColormapProcPtr CreateColormap;
889
DestroyColormapProcPtr DestroyColormap;
890
InstallColormapProcPtr InstallColormap;
891
UninstallColormapProcPtr UninstallColormap;
892
ListInstalledColormapsProcPtr ListInstalledColormaps;
893
StoreColorsProcPtr StoreColors;
894
ResolveColorProcPtr ResolveColor;
896
/* Region procedures */
898
#ifdef NEED_SCREEN_REGIONS
899
RegionCreateProcPtr RegionCreate;
900
RegionInitProcPtr RegionInit;
901
RegionCopyProcPtr RegionCopy;
902
RegionDestroyProcPtr RegionDestroy;
903
RegionUninitProcPtr RegionUninit;
904
IntersectProcPtr Intersect;
906
SubtractProcPtr Subtract;
907
InverseProcPtr Inverse;
908
RegionResetProcPtr RegionReset;
909
TranslateRegionProcPtr TranslateRegion;
910
RectInProcPtr RectIn;
911
PointInRegionProcPtr PointInRegion;
912
RegionNotEmptyProcPtr RegionNotEmpty;
913
RegionBrokenProcPtr RegionBroken;
914
RegionBreakProcPtr RegionBreak;
915
RegionEmptyProcPtr RegionEmpty;
916
RegionExtentsProcPtr RegionExtents;
917
RegionAppendProcPtr RegionAppend;
918
RegionValidateProcPtr RegionValidate;
919
#endif /* NEED_SCREEN_REGIONS */
920
BitmapToRegionProcPtr BitmapToRegion;
921
#ifdef NEED_SCREEN_REGIONS
922
RectsToRegionProcPtr RectsToRegion;
923
#endif /* NEED_SCREEN_REGIONS */
924
SendGraphicsExposeProcPtr SendGraphicsExpose;
926
/* os layer procedures */
928
ScreenBlockHandlerProcPtr BlockHandler;
929
ScreenWakeupHandlerProcPtr WakeupHandler;
934
/* anybody can get a piece of this array */
935
DevUnion *devPrivates;
937
CreateScreenResourcesProcPtr CreateScreenResources;
938
ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
940
GetWindowPixmapProcPtr GetWindowPixmap;
941
SetWindowPixmapProcPtr SetWindowPixmap;
942
GetScreenPixmapProcPtr GetScreenPixmap;
943
SetScreenPixmapProcPtr SetScreenPixmap;
945
PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
948
int PixmapPrivateLen;
949
unsigned int *PixmapPrivateSizes;
950
unsigned int totalPixmapSize;
953
MarkWindowProcPtr MarkWindow;
954
MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
955
ChangeSaveUnderProcPtr ChangeSaveUnder;
956
PostChangeSaveUnderProcPtr PostChangeSaveUnder;
957
MoveWindowProcPtr MoveWindow;
958
ResizeWindowProcPtr ResizeWindow;
959
GetLayerWindowProcPtr GetLayerWindow;
960
HandleExposuresProcPtr HandleExposures;
961
ReparentWindowProcPtr ReparentWindow;
964
SetShapeProcPtr SetShape;
967
ChangeBorderWidthProcPtr ChangeBorderWidth;
968
MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
972
typedef struct _ScreenInfo {
974
int bitmapScanlineUnit;
975
int bitmapScanlinePad;
977
int numPixmapFormats;
982
ScreenPtr screens[MAXSCREENS];
986
extern ScreenInfo screenInfo;
988
extern void InitOutput(
989
#if NeedFunctionPrototypes
990
ScreenInfo * /*pScreenInfo*/,
996
#endif /* SCREENINTSTRUCT_H */