xref: /OK3568_Linux_fs/external/xserver/include/scrnintstr.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /***********************************************************
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun Copyright 1987, 1998  The Open Group
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun Permission to use, copy, modify, distribute, and sell this software and its
6*4882a593Smuzhiyun documentation for any purpose is hereby granted without fee, provided that
7*4882a593Smuzhiyun the above copyright notice appear in all copies and that both that
8*4882a593Smuzhiyun copyright notice and this permission notice appear in supporting
9*4882a593Smuzhiyun documentation.
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun The above copyright notice and this permission notice shall be included in
12*4882a593Smuzhiyun all copies or substantial portions of the Software.
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*4882a593Smuzhiyun IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*4882a593Smuzhiyun FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17*4882a593Smuzhiyun OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18*4882a593Smuzhiyun AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19*4882a593Smuzhiyun CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun Except as contained in this notice, the name of The Open Group shall not be
22*4882a593Smuzhiyun used in advertising or otherwise to promote the sale, use or other dealings
23*4882a593Smuzhiyun in this Software without prior written authorization from The Open Group.
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun                         All Rights Reserved
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun Permission to use, copy, modify, and distribute this software and its
30*4882a593Smuzhiyun documentation for any purpose and without fee is hereby granted,
31*4882a593Smuzhiyun provided that the above copyright notice appear in all copies and that
32*4882a593Smuzhiyun both that copyright notice and this permission notice appear in
33*4882a593Smuzhiyun supporting documentation, and that the name of Digital not be
34*4882a593Smuzhiyun used in advertising or publicity pertaining to distribution of the
35*4882a593Smuzhiyun software without specific, written prior permission.
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38*4882a593Smuzhiyun ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39*4882a593Smuzhiyun DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
40*4882a593Smuzhiyun ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41*4882a593Smuzhiyun WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42*4882a593Smuzhiyun ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43*4882a593Smuzhiyun SOFTWARE.
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun ******************************************************************/
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #ifndef SCREENINTSTRUCT_H
48*4882a593Smuzhiyun #define SCREENINTSTRUCT_H
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #include "screenint.h"
51*4882a593Smuzhiyun #include "regionstr.h"
52*4882a593Smuzhiyun #include "colormap.h"
53*4882a593Smuzhiyun #include "cursor.h"
54*4882a593Smuzhiyun #include "validate.h"
55*4882a593Smuzhiyun #include <X11/Xproto.h>
56*4882a593Smuzhiyun #include "dix.h"
57*4882a593Smuzhiyun #include "privates.h"
58*4882a593Smuzhiyun #include <X11/extensions/randr.h>
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun typedef struct _PixmapFormat {
61*4882a593Smuzhiyun     unsigned char depth;
62*4882a593Smuzhiyun     unsigned char bitsPerPixel;
63*4882a593Smuzhiyun     unsigned char scanlinePad;
64*4882a593Smuzhiyun } PixmapFormatRec;
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun typedef struct _Visual {
67*4882a593Smuzhiyun     VisualID vid;
68*4882a593Smuzhiyun     short class;
69*4882a593Smuzhiyun     short bitsPerRGBValue;
70*4882a593Smuzhiyun     short ColormapEntries;
71*4882a593Smuzhiyun     short nplanes;              /* = log2 (ColormapEntries). This does not
72*4882a593Smuzhiyun                                  * imply that the screen has this many planes.
73*4882a593Smuzhiyun                                  * it may have more or fewer */
74*4882a593Smuzhiyun     unsigned long redMask, greenMask, blueMask;
75*4882a593Smuzhiyun     int offsetRed, offsetGreen, offsetBlue;
76*4882a593Smuzhiyun } VisualRec;
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun typedef struct _Depth {
79*4882a593Smuzhiyun     unsigned char depth;
80*4882a593Smuzhiyun     short numVids;
81*4882a593Smuzhiyun     VisualID *vids;             /* block of visual ids for this depth */
82*4882a593Smuzhiyun } DepthRec;
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun typedef struct _ScreenSaverStuff {
85*4882a593Smuzhiyun     WindowPtr pWindow;
86*4882a593Smuzhiyun     XID wid;
87*4882a593Smuzhiyun     char blanked;
88*4882a593Smuzhiyun     Bool (*ExternalScreenSaver) (ScreenPtr /*pScreen */ ,
89*4882a593Smuzhiyun                                  int /*xstate */ ,
90*4882a593Smuzhiyun                                  Bool /*force */ );
91*4882a593Smuzhiyun } ScreenSaverStuffRec;
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun /*
94*4882a593Smuzhiyun  *  There is a typedef for each screen function pointer so that code that
95*4882a593Smuzhiyun  *  needs to declare a screen function pointer (e.g. in a screen private
96*4882a593Smuzhiyun  *  or as a local variable) can easily do so and retain full type checking.
97*4882a593Smuzhiyun  */
98*4882a593Smuzhiyun 
99*4882a593Smuzhiyun typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
100*4882a593Smuzhiyun 
101*4882a593Smuzhiyun typedef void (*QueryBestSizeProcPtr) (int /*class */ ,
102*4882a593Smuzhiyun                                       unsigned short * /*pwidth */ ,
103*4882a593Smuzhiyun                                       unsigned short * /*pheight */ ,
104*4882a593Smuzhiyun                                       ScreenPtr /*pScreen */ );
105*4882a593Smuzhiyun 
106*4882a593Smuzhiyun typedef Bool (*SaveScreenProcPtr) (ScreenPtr /*pScreen */ ,
107*4882a593Smuzhiyun                                    int /*on */ );
108*4882a593Smuzhiyun 
109*4882a593Smuzhiyun typedef void (*GetImageProcPtr) (DrawablePtr /*pDrawable */ ,
110*4882a593Smuzhiyun                                  int /*sx */ ,
111*4882a593Smuzhiyun                                  int /*sy */ ,
112*4882a593Smuzhiyun                                  int /*w */ ,
113*4882a593Smuzhiyun                                  int /*h */ ,
114*4882a593Smuzhiyun                                  unsigned int /*format */ ,
115*4882a593Smuzhiyun                                  unsigned long /*planeMask */ ,
116*4882a593Smuzhiyun                                  char * /*pdstLine */ );
117*4882a593Smuzhiyun 
118*4882a593Smuzhiyun typedef void (*GetSpansProcPtr) (DrawablePtr /*pDrawable */ ,
119*4882a593Smuzhiyun                                  int /*wMax */ ,
120*4882a593Smuzhiyun                                  DDXPointPtr /*ppt */ ,
121*4882a593Smuzhiyun                                  int * /*pwidth */ ,
122*4882a593Smuzhiyun                                  int /*nspans */ ,
123*4882a593Smuzhiyun                                  char * /*pdstStart */ );
124*4882a593Smuzhiyun 
125*4882a593Smuzhiyun typedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ ,
126*4882a593Smuzhiyun                                        int /*x */ ,
127*4882a593Smuzhiyun                                        int /*y */ ,
128*4882a593Smuzhiyun                                        int /*width */ ,
129*4882a593Smuzhiyun                                        int /*height */ ,
130*4882a593Smuzhiyun                                        unsigned int /*subWindowMode */ );
131*4882a593Smuzhiyun 
132*4882a593Smuzhiyun typedef Bool (*CreateWindowProcPtr) (WindowPtr /*pWindow */ );
133*4882a593Smuzhiyun 
134*4882a593Smuzhiyun typedef Bool (*DestroyWindowProcPtr) (WindowPtr /*pWindow */ );
135*4882a593Smuzhiyun 
136*4882a593Smuzhiyun typedef Bool (*PositionWindowProcPtr) (WindowPtr /*pWindow */ ,
137*4882a593Smuzhiyun                                        int /*x */ ,
138*4882a593Smuzhiyun                                        int /*y */ );
139*4882a593Smuzhiyun 
140*4882a593Smuzhiyun typedef Bool (*ChangeWindowAttributesProcPtr) (WindowPtr /*pWindow */ ,
141*4882a593Smuzhiyun                                                unsigned long /*mask */ );
142*4882a593Smuzhiyun 
143*4882a593Smuzhiyun typedef Bool (*RealizeWindowProcPtr) (WindowPtr /*pWindow */ );
144*4882a593Smuzhiyun 
145*4882a593Smuzhiyun typedef Bool (*UnrealizeWindowProcPtr) (WindowPtr /*pWindow */ );
146*4882a593Smuzhiyun 
147*4882a593Smuzhiyun typedef void (*RestackWindowProcPtr) (WindowPtr /*pWindow */ ,
148*4882a593Smuzhiyun                                       WindowPtr /*pOldNextSib */ );
149*4882a593Smuzhiyun 
150*4882a593Smuzhiyun typedef int (*ValidateTreeProcPtr) (WindowPtr /*pParent */ ,
151*4882a593Smuzhiyun                                     WindowPtr /*pChild */ ,
152*4882a593Smuzhiyun                                     VTKind /*kind */ );
153*4882a593Smuzhiyun 
154*4882a593Smuzhiyun typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
155*4882a593Smuzhiyun                                          WindowPtr /*pChild */ ,
156*4882a593Smuzhiyun                                          VTKind /*kind */ );
157*4882a593Smuzhiyun 
158*4882a593Smuzhiyun typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
159*4882a593Smuzhiyun                                         RegionPtr /*prgn */);
160*4882a593Smuzhiyun 
161*4882a593Smuzhiyun typedef void (*PaintWindowProcPtr) (WindowPtr /*pWindow*/,
162*4882a593Smuzhiyun                                     RegionPtr /*pRegion*/,
163*4882a593Smuzhiyun                                     int /*what*/);
164*4882a593Smuzhiyun 
165*4882a593Smuzhiyun typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
166*4882a593Smuzhiyun                                    DDXPointRec /*ptOldOrg */ ,
167*4882a593Smuzhiyun                                    RegionPtr /*prgnSrc */ );
168*4882a593Smuzhiyun 
169*4882a593Smuzhiyun typedef void (*ClearToBackgroundProcPtr) (WindowPtr /*pWindow */ ,
170*4882a593Smuzhiyun                                           int /*x */ ,
171*4882a593Smuzhiyun                                           int /*y */ ,
172*4882a593Smuzhiyun                                           int /*w */ ,
173*4882a593Smuzhiyun                                           int /*h */ ,
174*4882a593Smuzhiyun                                           Bool /*generateExposures */ );
175*4882a593Smuzhiyun 
176*4882a593Smuzhiyun typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ ,
177*4882a593Smuzhiyun                                    int /*dx */ ,
178*4882a593Smuzhiyun                                    int /*dy */ );
179*4882a593Smuzhiyun 
180*4882a593Smuzhiyun /* pixmap will exist only for the duration of the current rendering operation */
181*4882a593Smuzhiyun #define CREATE_PIXMAP_USAGE_SCRATCH                     1
182*4882a593Smuzhiyun /* pixmap will be the backing pixmap for a redirected window */
183*4882a593Smuzhiyun #define CREATE_PIXMAP_USAGE_BACKING_PIXMAP              2
184*4882a593Smuzhiyun /* pixmap will contain a glyph */
185*4882a593Smuzhiyun #define CREATE_PIXMAP_USAGE_GLYPH_PICTURE               3
186*4882a593Smuzhiyun /* pixmap will be shared */
187*4882a593Smuzhiyun #define CREATE_PIXMAP_USAGE_SHARED                      4
188*4882a593Smuzhiyun 
189*4882a593Smuzhiyun typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ ,
190*4882a593Smuzhiyun                                           int /*width */ ,
191*4882a593Smuzhiyun                                           int /*height */ ,
192*4882a593Smuzhiyun                                           int /*depth */ ,
193*4882a593Smuzhiyun                                           unsigned /*usage_hint */ );
194*4882a593Smuzhiyun 
195*4882a593Smuzhiyun typedef Bool (*DestroyPixmapProcPtr) (PixmapPtr /*pPixmap */ );
196*4882a593Smuzhiyun 
197*4882a593Smuzhiyun typedef Bool (*RealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
198*4882a593Smuzhiyun                                     FontPtr /*pFont */ );
199*4882a593Smuzhiyun 
200*4882a593Smuzhiyun typedef Bool (*UnrealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
201*4882a593Smuzhiyun                                       FontPtr /*pFont */ );
202*4882a593Smuzhiyun 
203*4882a593Smuzhiyun typedef void (*ConstrainCursorProcPtr) (DeviceIntPtr /*pDev */ ,
204*4882a593Smuzhiyun                                         ScreenPtr /*pScreen */ ,
205*4882a593Smuzhiyun                                         BoxPtr /*pBox */ );
206*4882a593Smuzhiyun 
207*4882a593Smuzhiyun typedef void (*CursorLimitsProcPtr) (DeviceIntPtr /* pDev */ ,
208*4882a593Smuzhiyun                                      ScreenPtr /*pScreen */ ,
209*4882a593Smuzhiyun                                      CursorPtr /*pCursor */ ,
210*4882a593Smuzhiyun                                      BoxPtr /*pHotBox */ ,
211*4882a593Smuzhiyun                                      BoxPtr /*pTopLeftBox */ );
212*4882a593Smuzhiyun 
213*4882a593Smuzhiyun typedef Bool (*DisplayCursorProcPtr) (DeviceIntPtr /* pDev */ ,
214*4882a593Smuzhiyun                                       ScreenPtr /*pScreen */ ,
215*4882a593Smuzhiyun                                       CursorPtr /*pCursor */ );
216*4882a593Smuzhiyun 
217*4882a593Smuzhiyun typedef Bool (*RealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
218*4882a593Smuzhiyun                                       ScreenPtr /*pScreen */ ,
219*4882a593Smuzhiyun                                       CursorPtr /*pCursor */ );
220*4882a593Smuzhiyun 
221*4882a593Smuzhiyun typedef Bool (*UnrealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
222*4882a593Smuzhiyun                                         ScreenPtr /*pScreen */ ,
223*4882a593Smuzhiyun                                         CursorPtr /*pCursor */ );
224*4882a593Smuzhiyun 
225*4882a593Smuzhiyun typedef void (*RecolorCursorProcPtr) (DeviceIntPtr /* pDev */ ,
226*4882a593Smuzhiyun                                       ScreenPtr /*pScreen */ ,
227*4882a593Smuzhiyun                                       CursorPtr /*pCursor */ ,
228*4882a593Smuzhiyun                                       Bool /*displayed */ );
229*4882a593Smuzhiyun 
230*4882a593Smuzhiyun typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ ,
231*4882a593Smuzhiyun                                           ScreenPtr /*pScreen */ ,
232*4882a593Smuzhiyun                                           int /*x */ ,
233*4882a593Smuzhiyun                                           int /*y */ ,
234*4882a593Smuzhiyun                                           Bool /*generateEvent */ );
235*4882a593Smuzhiyun 
236*4882a593Smuzhiyun typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ ,
237*4882a593Smuzhiyun                                        ScreenPtr /*pScreen */ ,
238*4882a593Smuzhiyun                                        ClientPtr /*pClient */ ,
239*4882a593Smuzhiyun                                        WindowPtr /*pWindow */ ,
240*4882a593Smuzhiyun                                        SpritePtr /*pSprite */ ,
241*4882a593Smuzhiyun                                        int /*x */ ,
242*4882a593Smuzhiyun                                        int /*y */ );
243*4882a593Smuzhiyun 
244*4882a593Smuzhiyun typedef void (*CurserConfinedToProcPtr) (DeviceIntPtr /* pDev */ ,
245*4882a593Smuzhiyun                                          ScreenPtr /*pScreen */ ,
246*4882a593Smuzhiyun                                          WindowPtr /*pWindow */ );
247*4882a593Smuzhiyun 
248*4882a593Smuzhiyun typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
249*4882a593Smuzhiyun 
250*4882a593Smuzhiyun typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
251*4882a593Smuzhiyun 
252*4882a593Smuzhiyun typedef void (*DestroyColormapProcPtr) (ColormapPtr /*pColormap */ );
253*4882a593Smuzhiyun 
254*4882a593Smuzhiyun typedef void (*InstallColormapProcPtr) (ColormapPtr /*pColormap */ );
255*4882a593Smuzhiyun 
256*4882a593Smuzhiyun typedef void (*UninstallColormapProcPtr) (ColormapPtr /*pColormap */ );
257*4882a593Smuzhiyun 
258*4882a593Smuzhiyun typedef int (*ListInstalledColormapsProcPtr) (ScreenPtr /*pScreen */ ,
259*4882a593Smuzhiyun                                               XID * /*pmaps */ );
260*4882a593Smuzhiyun 
261*4882a593Smuzhiyun typedef void (*StoreColorsProcPtr) (ColormapPtr /*pColormap */ ,
262*4882a593Smuzhiyun                                     int /*ndef */ ,
263*4882a593Smuzhiyun                                     xColorItem * /*pdef */ );
264*4882a593Smuzhiyun 
265*4882a593Smuzhiyun typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
266*4882a593Smuzhiyun                                      unsigned short * /*pgreen */ ,
267*4882a593Smuzhiyun                                      unsigned short * /*pblue */ ,
268*4882a593Smuzhiyun                                      VisualPtr /*pVisual */ );
269*4882a593Smuzhiyun 
270*4882a593Smuzhiyun typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
271*4882a593Smuzhiyun 
272*4882a593Smuzhiyun typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
273*4882a593Smuzhiyun                                            void *timeout);
274*4882a593Smuzhiyun 
275*4882a593Smuzhiyun /* result has three possible values:
276*4882a593Smuzhiyun  * < 0 - error
277*4882a593Smuzhiyun  * = 0 - timeout
278*4882a593Smuzhiyun  * > 0 - activity
279*4882a593Smuzhiyun  */
280*4882a593Smuzhiyun typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen,
281*4882a593Smuzhiyun                                             int result);
282*4882a593Smuzhiyun 
283*4882a593Smuzhiyun typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ );
284*4882a593Smuzhiyun 
285*4882a593Smuzhiyun typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap,
286*4882a593Smuzhiyun                                            int width,
287*4882a593Smuzhiyun                                            int height,
288*4882a593Smuzhiyun                                            int depth,
289*4882a593Smuzhiyun                                            int bitsPerPixel,
290*4882a593Smuzhiyun                                            int devKind,
291*4882a593Smuzhiyun                                            void *pPixData);
292*4882a593Smuzhiyun 
293*4882a593Smuzhiyun typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ );
294*4882a593Smuzhiyun 
295*4882a593Smuzhiyun typedef void (*SetWindowPixmapProcPtr) (WindowPtr /*pWin */ ,
296*4882a593Smuzhiyun                                         PixmapPtr /*pPix */ );
297*4882a593Smuzhiyun 
298*4882a593Smuzhiyun typedef PixmapPtr (*GetScreenPixmapProcPtr) (ScreenPtr /*pScreen */ );
299*4882a593Smuzhiyun 
300*4882a593Smuzhiyun typedef void (*SetScreenPixmapProcPtr) (PixmapPtr /*pPix */ );
301*4882a593Smuzhiyun 
302*4882a593Smuzhiyun typedef void (*MarkWindowProcPtr) (WindowPtr /*pWin */ );
303*4882a593Smuzhiyun 
304*4882a593Smuzhiyun typedef Bool (*MarkOverlappedWindowsProcPtr) (WindowPtr /*parent */ ,
305*4882a593Smuzhiyun                                               WindowPtr /*firstChild */ ,
306*4882a593Smuzhiyun                                               WindowPtr * /*pLayerWin */ );
307*4882a593Smuzhiyun 
308*4882a593Smuzhiyun typedef int (*ConfigNotifyProcPtr) (WindowPtr /*pWin */ ,
309*4882a593Smuzhiyun                                     int /*x */ ,
310*4882a593Smuzhiyun                                     int /*y */ ,
311*4882a593Smuzhiyun                                     int /*w */ ,
312*4882a593Smuzhiyun                                     int /*h */ ,
313*4882a593Smuzhiyun                                     int /*bw */ ,
314*4882a593Smuzhiyun                                     WindowPtr /*pSib */ );
315*4882a593Smuzhiyun 
316*4882a593Smuzhiyun typedef void (*MoveWindowProcPtr) (WindowPtr /*pWin */ ,
317*4882a593Smuzhiyun                                    int /*x */ ,
318*4882a593Smuzhiyun                                    int /*y */ ,
319*4882a593Smuzhiyun                                    WindowPtr /*pSib */ ,
320*4882a593Smuzhiyun                                    VTKind /*kind */ );
321*4882a593Smuzhiyun 
322*4882a593Smuzhiyun typedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ ,
323*4882a593Smuzhiyun                                      int /*x */ ,
324*4882a593Smuzhiyun                                      int /*y */ ,
325*4882a593Smuzhiyun                                      unsigned int /*w */ ,
326*4882a593Smuzhiyun                                      unsigned int /*h */ ,
327*4882a593Smuzhiyun                                      WindowPtr  /*pSib */
328*4882a593Smuzhiyun     );
329*4882a593Smuzhiyun 
330*4882a593Smuzhiyun typedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr   /*pWin */
331*4882a593Smuzhiyun     );
332*4882a593Smuzhiyun 
333*4882a593Smuzhiyun typedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ );
334*4882a593Smuzhiyun 
335*4882a593Smuzhiyun typedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ ,
336*4882a593Smuzhiyun                                        WindowPtr /*pPriorParent */ );
337*4882a593Smuzhiyun 
338*4882a593Smuzhiyun typedef void (*SetShapeProcPtr) (WindowPtr /*pWin */ ,
339*4882a593Smuzhiyun                                  int /* kind */ );
340*4882a593Smuzhiyun 
341*4882a593Smuzhiyun typedef void (*ChangeBorderWidthProcPtr) (WindowPtr /*pWin */ ,
342*4882a593Smuzhiyun                                           unsigned int /*width */ );
343*4882a593Smuzhiyun 
344*4882a593Smuzhiyun typedef void (*MarkUnrealizedWindowProcPtr) (WindowPtr /*pChild */ ,
345*4882a593Smuzhiyun                                              WindowPtr /*pWin */ ,
346*4882a593Smuzhiyun                                              Bool /*fromConfigure */ );
347*4882a593Smuzhiyun 
348*4882a593Smuzhiyun typedef Bool (*DeviceCursorInitializeProcPtr) (DeviceIntPtr /* pDev */ ,
349*4882a593Smuzhiyun                                                ScreenPtr /* pScreen */ );
350*4882a593Smuzhiyun 
351*4882a593Smuzhiyun typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,
352*4882a593Smuzhiyun                                             ScreenPtr /* pScreen */ );
353*4882a593Smuzhiyun 
354*4882a593Smuzhiyun typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,
355*4882a593Smuzhiyun                                               int *, int *);
356*4882a593Smuzhiyun 
357*4882a593Smuzhiyun 
358*4882a593Smuzhiyun typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
359*4882a593Smuzhiyun 
360*4882a593Smuzhiyun typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
361*4882a593Smuzhiyun 
362*4882a593Smuzhiyun #define HAS_SYNC_SHARED_PIXMAP 1
363*4882a593Smuzhiyun /* The SyncSharedPixmap hook has two purposes:
364*4882a593Smuzhiyun  *
365*4882a593Smuzhiyun  * 1. If the master driver has it, the slave driver can use it to
366*4882a593Smuzhiyun  * synchronize the shared pixmap contents with the screen pixmap.
367*4882a593Smuzhiyun  * 2. If the slave driver has it, the master driver can expect the slave
368*4882a593Smuzhiyun  * driver to call the master screen's SyncSharedPixmap hook, so the master
369*4882a593Smuzhiyun  * driver doesn't have to synchronize the shared pixmap contents itself,
370*4882a593Smuzhiyun  * e.g. from the BlockHandler.
371*4882a593Smuzhiyun  *
372*4882a593Smuzhiyun  * A driver must only set the hook if it handles both cases correctly.
373*4882a593Smuzhiyun  *
374*4882a593Smuzhiyun  * The argument is the slave screen's pixmap_dirty_list entry, the hook is
375*4882a593Smuzhiyun  * responsible for finding the corresponding entry in the master screen's
376*4882a593Smuzhiyun  * pixmap_dirty_list.
377*4882a593Smuzhiyun  */
378*4882a593Smuzhiyun typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr);
379*4882a593Smuzhiyun 
380*4882a593Smuzhiyun typedef Bool (*StartPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr,
381*4882a593Smuzhiyun                                            int x, int y,
382*4882a593Smuzhiyun                                            int dst_x, int dst_y,
383*4882a593Smuzhiyun                                            Rotation rotation);
384*4882a593Smuzhiyun 
385*4882a593Smuzhiyun typedef Bool (*PresentSharedPixmapProcPtr)(PixmapPtr);
386*4882a593Smuzhiyun 
387*4882a593Smuzhiyun typedef Bool (*RequestSharedPixmapNotifyDamageProcPtr)(PixmapPtr);
388*4882a593Smuzhiyun 
389*4882a593Smuzhiyun typedef Bool (*StopPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr);
390*4882a593Smuzhiyun 
391*4882a593Smuzhiyun typedef Bool (*StopFlippingPixmapTrackingProcPtr)(DrawablePtr,
392*4882a593Smuzhiyun                                                   PixmapPtr, PixmapPtr);
393*4882a593Smuzhiyun 
394*4882a593Smuzhiyun typedef Bool (*SharedPixmapNotifyDamageProcPtr)(PixmapPtr);
395*4882a593Smuzhiyun 
396*4882a593Smuzhiyun typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
397*4882a593Smuzhiyun 
398*4882a593Smuzhiyun typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen,
399*4882a593Smuzhiyun                                        SpritePtr pSprite, int x, int y);
400*4882a593Smuzhiyun 
401*4882a593Smuzhiyun typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32);
402*4882a593Smuzhiyun 
403*4882a593Smuzhiyun typedef void (*DPMSProcPtr)(ScreenPtr pScreen, int level);
404*4882a593Smuzhiyun 
405*4882a593Smuzhiyun /* Wrapping Screen procedures
406*4882a593Smuzhiyun 
407*4882a593Smuzhiyun    There are a few modules in the X server which dynamically add and
408*4882a593Smuzhiyun     remove themselves from various screen procedure call chains.
409*4882a593Smuzhiyun 
410*4882a593Smuzhiyun     For example, the BlockHandler is dynamically modified by:
411*4882a593Smuzhiyun 
412*4882a593Smuzhiyun      * xf86Rotate
413*4882a593Smuzhiyun      * miSprite
414*4882a593Smuzhiyun      * composite
415*4882a593Smuzhiyun      * render (for animated cursors)
416*4882a593Smuzhiyun 
417*4882a593Smuzhiyun     Correctly manipulating this chain is complicated by the fact that
418*4882a593Smuzhiyun     the chain is constructed through a sequence of screen private
419*4882a593Smuzhiyun     structures, each holding the next screen->proc pointer.
420*4882a593Smuzhiyun 
421*4882a593Smuzhiyun     To add a module to a screen->proc chain is fairly simple; just save
422*4882a593Smuzhiyun     the current screen->proc value in the module screen private
423*4882a593Smuzhiyun     and store the module's function in the screen->proc location.
424*4882a593Smuzhiyun 
425*4882a593Smuzhiyun     Removing a screen proc is a bit trickier. It seems like all you
426*4882a593Smuzhiyun     need to do is set the screen->proc pointer back to the value saved
427*4882a593Smuzhiyun     in your screen private. However, if some other module has come
428*4882a593Smuzhiyun     along and wrapped on top of you, then the right place to store the
429*4882a593Smuzhiyun     previous screen->proc value is actually in the wrapping module's
430*4882a593Smuzhiyun     screen private structure(!). Of course, you have no idea what
431*4882a593Smuzhiyun     other module may have wrapped on top, nor could you poke inside
432*4882a593Smuzhiyun     its screen private in any case.
433*4882a593Smuzhiyun 
434*4882a593Smuzhiyun     To make this work, we restrict the unwrapping process to happen
435*4882a593Smuzhiyun     during the invocation of the screen proc itself, and then we
436*4882a593Smuzhiyun     require the screen proc to take some care when manipulating the
437*4882a593Smuzhiyun     screen proc functions pointers.
438*4882a593Smuzhiyun 
439*4882a593Smuzhiyun     The requirements are:
440*4882a593Smuzhiyun 
441*4882a593Smuzhiyun      1) The screen proc must set the screen->proc pointer back to the
442*4882a593Smuzhiyun         value saved in its screen private before calling outside its
443*4882a593Smuzhiyun         module.
444*4882a593Smuzhiyun 
445*4882a593Smuzhiyun      2a) If the screen proc wants to be remove itself from the chain,
446*4882a593Smuzhiyun          it must not manipulate screen->proc pointer again before
447*4882a593Smuzhiyun          returning.
448*4882a593Smuzhiyun 
449*4882a593Smuzhiyun      2b) If the screen proc wants to remain in the chain, it must:
450*4882a593Smuzhiyun 
451*4882a593Smuzhiyun        2b.1) Re-fetch the screen->proc pointer and store that in
452*4882a593Smuzhiyun              its screen private. This ensures that any changes
453*4882a593Smuzhiyun              to the chain will be preserved.
454*4882a593Smuzhiyun 
455*4882a593Smuzhiyun        2b.2) Set screen->proc back to itself
456*4882a593Smuzhiyun 
457*4882a593Smuzhiyun     One key requirement here is that these steps must wrap not just
458*4882a593Smuzhiyun     any invocation of the nested screen->proc value, but must nest
459*4882a593Smuzhiyun     essentially any calls outside the current module. This ensures
460*4882a593Smuzhiyun     that other modules can reliably manipulate screen->proc wrapping
461*4882a593Smuzhiyun     using these same rules.
462*4882a593Smuzhiyun 
463*4882a593Smuzhiyun     For example, the animated cursor code in render has two macros,
464*4882a593Smuzhiyun     Wrap and Unwrap.
465*4882a593Smuzhiyun 
466*4882a593Smuzhiyun         #define Unwrap(as,s,elt)    ((s)->elt = (as)->elt)
467*4882a593Smuzhiyun 
468*4882a593Smuzhiyun     Unwrap takes the screen private (as), the screen (s) and the
469*4882a593Smuzhiyun     member name (elt), and restores screen->proc to that saved in the
470*4882a593Smuzhiyun     screen private.
471*4882a593Smuzhiyun 
472*4882a593Smuzhiyun         #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
473*4882a593Smuzhiyun 
474*4882a593Smuzhiyun     Wrap takes the screen private (as), the screen (s), the member
475*4882a593Smuzhiyun     name (elt) and the wrapping function (func). It saves the
476*4882a593Smuzhiyun     current screen->proc value in the screen private, and then sets the
477*4882a593Smuzhiyun     screen->proc to the local wrapping function.
478*4882a593Smuzhiyun 
479*4882a593Smuzhiyun     Within each of these functions, there's a pretty simple pattern:
480*4882a593Smuzhiyun 
481*4882a593Smuzhiyun         Unwrap(as, pScreen, UnrealizeCursor);
482*4882a593Smuzhiyun 
483*4882a593Smuzhiyun         // Do local stuff, including possibly calling down through
484*4882a593Smuzhiyun         // pScreen->UnrealizeCursor
485*4882a593Smuzhiyun 
486*4882a593Smuzhiyun         Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
487*4882a593Smuzhiyun 
488*4882a593Smuzhiyun     The wrapping block handler is a bit different; it does the Unwrap,
489*4882a593Smuzhiyun     the local operations and then only re-Wraps if the hook is still
490*4882a593Smuzhiyun     required. Unwrap occurrs at the top of each function, just after
491*4882a593Smuzhiyun     entry, and Wrap occurrs at the bottom of each function, just
492*4882a593Smuzhiyun     before returning.
493*4882a593Smuzhiyun  */
494*4882a593Smuzhiyun 
495*4882a593Smuzhiyun typedef struct _Screen {
496*4882a593Smuzhiyun     int myNum;                  /* index of this instance in Screens[] */
497*4882a593Smuzhiyun     ATOM id;
498*4882a593Smuzhiyun     short x, y, width, height;
499*4882a593Smuzhiyun     short mmWidth, mmHeight;
500*4882a593Smuzhiyun     short numDepths;
501*4882a593Smuzhiyun     unsigned char rootDepth;
502*4882a593Smuzhiyun     DepthPtr allowedDepths;
503*4882a593Smuzhiyun     unsigned long rootVisual;
504*4882a593Smuzhiyun     unsigned long defColormap;
505*4882a593Smuzhiyun     short minInstalledCmaps, maxInstalledCmaps;
506*4882a593Smuzhiyun     char backingStoreSupport, saveUnderSupport;
507*4882a593Smuzhiyun     unsigned long whitePixel, blackPixel;
508*4882a593Smuzhiyun     GCPtr GCperDepth[MAXFORMATS + 1];
509*4882a593Smuzhiyun     /* next field is a stipple to use as default in a GC.  we don't build
510*4882a593Smuzhiyun      * default tiles of all depths because they are likely to be of a color
511*4882a593Smuzhiyun      * different from the default fg pixel, so we don't win anything by
512*4882a593Smuzhiyun      * building a standard one.
513*4882a593Smuzhiyun      */
514*4882a593Smuzhiyun     PixmapPtr defaultStipple;
515*4882a593Smuzhiyun     void *devPrivate;
516*4882a593Smuzhiyun     short numVisuals;
517*4882a593Smuzhiyun     VisualPtr visuals;
518*4882a593Smuzhiyun     WindowPtr root;
519*4882a593Smuzhiyun     ScreenSaverStuffRec screensaver;
520*4882a593Smuzhiyun 
521*4882a593Smuzhiyun     DevPrivateSetRec    screenSpecificPrivates[PRIVATE_LAST];
522*4882a593Smuzhiyun 
523*4882a593Smuzhiyun     /* Random screen procedures */
524*4882a593Smuzhiyun 
525*4882a593Smuzhiyun     CloseScreenProcPtr CloseScreen;
526*4882a593Smuzhiyun     QueryBestSizeProcPtr QueryBestSize;
527*4882a593Smuzhiyun     SaveScreenProcPtr SaveScreen;
528*4882a593Smuzhiyun     GetImageProcPtr GetImage;
529*4882a593Smuzhiyun     GetSpansProcPtr GetSpans;
530*4882a593Smuzhiyun     SourceValidateProcPtr SourceValidate;
531*4882a593Smuzhiyun 
532*4882a593Smuzhiyun     /* Window Procedures */
533*4882a593Smuzhiyun 
534*4882a593Smuzhiyun     CreateWindowProcPtr CreateWindow;
535*4882a593Smuzhiyun     DestroyWindowProcPtr DestroyWindow;
536*4882a593Smuzhiyun     PositionWindowProcPtr PositionWindow;
537*4882a593Smuzhiyun     ChangeWindowAttributesProcPtr ChangeWindowAttributes;
538*4882a593Smuzhiyun     RealizeWindowProcPtr RealizeWindow;
539*4882a593Smuzhiyun     UnrealizeWindowProcPtr UnrealizeWindow;
540*4882a593Smuzhiyun     ValidateTreeProcPtr ValidateTree;
541*4882a593Smuzhiyun     PostValidateTreeProcPtr PostValidateTree;
542*4882a593Smuzhiyun     WindowExposuresProcPtr WindowExposures;
543*4882a593Smuzhiyun     CopyWindowProcPtr CopyWindow;
544*4882a593Smuzhiyun     ClearToBackgroundProcPtr ClearToBackground;
545*4882a593Smuzhiyun     ClipNotifyProcPtr ClipNotify;
546*4882a593Smuzhiyun     RestackWindowProcPtr RestackWindow;
547*4882a593Smuzhiyun     PaintWindowProcPtr PaintWindow;
548*4882a593Smuzhiyun 
549*4882a593Smuzhiyun     /* Pixmap procedures */
550*4882a593Smuzhiyun 
551*4882a593Smuzhiyun     CreatePixmapProcPtr CreatePixmap;
552*4882a593Smuzhiyun     DestroyPixmapProcPtr DestroyPixmap;
553*4882a593Smuzhiyun 
554*4882a593Smuzhiyun     /* Font procedures */
555*4882a593Smuzhiyun 
556*4882a593Smuzhiyun     RealizeFontProcPtr RealizeFont;
557*4882a593Smuzhiyun     UnrealizeFontProcPtr UnrealizeFont;
558*4882a593Smuzhiyun 
559*4882a593Smuzhiyun     /* Cursor Procedures */
560*4882a593Smuzhiyun 
561*4882a593Smuzhiyun     ConstrainCursorProcPtr ConstrainCursor;
562*4882a593Smuzhiyun     ConstrainCursorHarderProcPtr ConstrainCursorHarder;
563*4882a593Smuzhiyun     CursorLimitsProcPtr CursorLimits;
564*4882a593Smuzhiyun     DisplayCursorProcPtr DisplayCursor;
565*4882a593Smuzhiyun     RealizeCursorProcPtr RealizeCursor;
566*4882a593Smuzhiyun     UnrealizeCursorProcPtr UnrealizeCursor;
567*4882a593Smuzhiyun     RecolorCursorProcPtr RecolorCursor;
568*4882a593Smuzhiyun     SetCursorPositionProcPtr SetCursorPosition;
569*4882a593Smuzhiyun     CursorWarpedToProcPtr CursorWarpedTo;
570*4882a593Smuzhiyun     CurserConfinedToProcPtr CursorConfinedTo;
571*4882a593Smuzhiyun 
572*4882a593Smuzhiyun     /* GC procedures */
573*4882a593Smuzhiyun 
574*4882a593Smuzhiyun     CreateGCProcPtr CreateGC;
575*4882a593Smuzhiyun 
576*4882a593Smuzhiyun     /* Colormap procedures */
577*4882a593Smuzhiyun 
578*4882a593Smuzhiyun     CreateColormapProcPtr CreateColormap;
579*4882a593Smuzhiyun     DestroyColormapProcPtr DestroyColormap;
580*4882a593Smuzhiyun     InstallColormapProcPtr InstallColormap;
581*4882a593Smuzhiyun     UninstallColormapProcPtr UninstallColormap;
582*4882a593Smuzhiyun     ListInstalledColormapsProcPtr ListInstalledColormaps;
583*4882a593Smuzhiyun     StoreColorsProcPtr StoreColors;
584*4882a593Smuzhiyun     ResolveColorProcPtr ResolveColor;
585*4882a593Smuzhiyun 
586*4882a593Smuzhiyun     /* Region procedures */
587*4882a593Smuzhiyun 
588*4882a593Smuzhiyun     BitmapToRegionProcPtr BitmapToRegion;
589*4882a593Smuzhiyun 
590*4882a593Smuzhiyun     /* os layer procedures */
591*4882a593Smuzhiyun 
592*4882a593Smuzhiyun     ScreenBlockHandlerProcPtr BlockHandler;
593*4882a593Smuzhiyun     ScreenWakeupHandlerProcPtr WakeupHandler;
594*4882a593Smuzhiyun 
595*4882a593Smuzhiyun     /* anybody can get a piece of this array */
596*4882a593Smuzhiyun     PrivateRec *devPrivates;
597*4882a593Smuzhiyun 
598*4882a593Smuzhiyun     CreateScreenResourcesProcPtr CreateScreenResources;
599*4882a593Smuzhiyun     ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
600*4882a593Smuzhiyun 
601*4882a593Smuzhiyun     GetWindowPixmapProcPtr GetWindowPixmap;
602*4882a593Smuzhiyun     SetWindowPixmapProcPtr SetWindowPixmap;
603*4882a593Smuzhiyun     GetScreenPixmapProcPtr GetScreenPixmap;
604*4882a593Smuzhiyun     SetScreenPixmapProcPtr SetScreenPixmap;
605*4882a593Smuzhiyun     NameWindowPixmapProcPtr NameWindowPixmap;
606*4882a593Smuzhiyun 
607*4882a593Smuzhiyun     PixmapPtr pScratchPixmap;   /* scratch pixmap "pool" */
608*4882a593Smuzhiyun 
609*4882a593Smuzhiyun     unsigned int totalPixmapSize;
610*4882a593Smuzhiyun 
611*4882a593Smuzhiyun     MarkWindowProcPtr MarkWindow;
612*4882a593Smuzhiyun     MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
613*4882a593Smuzhiyun     ConfigNotifyProcPtr ConfigNotify;
614*4882a593Smuzhiyun     MoveWindowProcPtr MoveWindow;
615*4882a593Smuzhiyun     ResizeWindowProcPtr ResizeWindow;
616*4882a593Smuzhiyun     GetLayerWindowProcPtr GetLayerWindow;
617*4882a593Smuzhiyun     HandleExposuresProcPtr HandleExposures;
618*4882a593Smuzhiyun     ReparentWindowProcPtr ReparentWindow;
619*4882a593Smuzhiyun 
620*4882a593Smuzhiyun     SetShapeProcPtr SetShape;
621*4882a593Smuzhiyun 
622*4882a593Smuzhiyun     ChangeBorderWidthProcPtr ChangeBorderWidth;
623*4882a593Smuzhiyun     MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
624*4882a593Smuzhiyun 
625*4882a593Smuzhiyun     /* Device cursor procedures */
626*4882a593Smuzhiyun     DeviceCursorInitializeProcPtr DeviceCursorInitialize;
627*4882a593Smuzhiyun     DeviceCursorCleanupProcPtr DeviceCursorCleanup;
628*4882a593Smuzhiyun 
629*4882a593Smuzhiyun     /* set it in driver side if X server can copy the framebuffer content.
630*4882a593Smuzhiyun      * Meant to be used together with '-background none' option, avoiding
631*4882a593Smuzhiyun      * malicious users to steal framebuffer's content if that would be the
632*4882a593Smuzhiyun      * default */
633*4882a593Smuzhiyun     Bool canDoBGNoneRoot;
634*4882a593Smuzhiyun 
635*4882a593Smuzhiyun     Bool isGPU;
636*4882a593Smuzhiyun 
637*4882a593Smuzhiyun     /* Info on this screen's slaves (if any) */
638*4882a593Smuzhiyun     struct xorg_list slave_list;
639*4882a593Smuzhiyun     struct xorg_list slave_head;
640*4882a593Smuzhiyun     int output_slaves;
641*4882a593Smuzhiyun     /* Info for when this screen is a slave */
642*4882a593Smuzhiyun     ScreenPtr current_master;
643*4882a593Smuzhiyun     Bool is_output_slave;
644*4882a593Smuzhiyun     Bool is_offload_slave;
645*4882a593Smuzhiyun 
646*4882a593Smuzhiyun     SharePixmapBackingProcPtr SharePixmapBacking;
647*4882a593Smuzhiyun     SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;
648*4882a593Smuzhiyun 
649*4882a593Smuzhiyun     StartPixmapTrackingProcPtr StartPixmapTracking;
650*4882a593Smuzhiyun     StopPixmapTrackingProcPtr StopPixmapTracking;
651*4882a593Smuzhiyun     SyncSharedPixmapProcPtr SyncSharedPixmap;
652*4882a593Smuzhiyun 
653*4882a593Smuzhiyun     SharedPixmapNotifyDamageProcPtr SharedPixmapNotifyDamage;
654*4882a593Smuzhiyun     RequestSharedPixmapNotifyDamageProcPtr RequestSharedPixmapNotifyDamage;
655*4882a593Smuzhiyun     PresentSharedPixmapProcPtr PresentSharedPixmap;
656*4882a593Smuzhiyun     StopFlippingPixmapTrackingProcPtr StopFlippingPixmapTracking;
657*4882a593Smuzhiyun 
658*4882a593Smuzhiyun     struct xorg_list pixmap_dirty_list;
659*4882a593Smuzhiyun 
660*4882a593Smuzhiyun     ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap;
661*4882a593Smuzhiyun     XYToWindowProcPtr XYToWindow;
662*4882a593Smuzhiyun     DPMSProcPtr DPMS;
663*4882a593Smuzhiyun } ScreenRec;
664*4882a593Smuzhiyun 
665*4882a593Smuzhiyun static inline RegionPtr
BitmapToRegion(ScreenPtr _pScreen,PixmapPtr pPix)666*4882a593Smuzhiyun BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix)
667*4882a593Smuzhiyun {
668*4882a593Smuzhiyun     return (*(_pScreen)->BitmapToRegion) (pPix);        /* no mi version?! */
669*4882a593Smuzhiyun }
670*4882a593Smuzhiyun 
671*4882a593Smuzhiyun typedef struct _ScreenInfo {
672*4882a593Smuzhiyun     int imageByteOrder;
673*4882a593Smuzhiyun     int bitmapScanlineUnit;
674*4882a593Smuzhiyun     int bitmapScanlinePad;
675*4882a593Smuzhiyun     int bitmapBitOrder;
676*4882a593Smuzhiyun     int numPixmapFormats;
677*4882a593Smuzhiyun      PixmapFormatRec formats[MAXFORMATS];
678*4882a593Smuzhiyun     int numScreens;
679*4882a593Smuzhiyun     ScreenPtr screens[MAXSCREENS];
680*4882a593Smuzhiyun     int numGPUScreens;
681*4882a593Smuzhiyun     ScreenPtr gpuscreens[MAXGPUSCREENS];
682*4882a593Smuzhiyun     int x;                      /* origin */
683*4882a593Smuzhiyun     int y;                      /* origin */
684*4882a593Smuzhiyun     int width;                  /* total width of all screens together */
685*4882a593Smuzhiyun     int height;                 /* total height of all screens together */
686*4882a593Smuzhiyun } ScreenInfo;
687*4882a593Smuzhiyun 
688*4882a593Smuzhiyun extern _X_EXPORT ScreenInfo screenInfo;
689*4882a593Smuzhiyun 
690*4882a593Smuzhiyun extern _X_EXPORT void InitOutput(ScreenInfo * /*pScreenInfo */ ,
691*4882a593Smuzhiyun                                  int /*argc */ ,
692*4882a593Smuzhiyun                                  char ** /*argv */ );
693*4882a593Smuzhiyun 
694*4882a593Smuzhiyun #endif                          /* SCREENINTSTRUCT_H */
695