3 Copyright 1993 by Davor Matic
5 Permission to use, copy, modify, distribute, and sell this software
6 and its documentation for any purpose is hereby granted without fee,
7 provided that the above copyright notice appear in all copies and that
8 both that copyright notice and this permission notice appear in
9 supporting documentation. Davor Matic makes no representations about
10 the suitability of this software for any purpose. It is provided "as
11 is" without express or implied warranty.
15 #ifdef HAVE_XNEST_CONFIG_H
16 #include <xnest-config.h>
20 #include <X11/Xproto.h>
21 #include "screenint.h"
24 #include "scrnintstr.h"
25 #include "windowstr.h"
28 #include <X11/fonts/fontstruct.h>
46 Bool xnestDoFullGeneration
= True
;
48 xEvent
*xnestEvents
= NULL
;
51 InitOutput(ScreenInfo
*screenInfo
, int argc
, char *argv
[])
55 xnestOpenDisplay(argc
, argv
);
57 screenInfo
->imageByteOrder
= ImageByteOrder(xnestDisplay
);
58 screenInfo
->bitmapScanlineUnit
= BitmapUnit(xnestDisplay
);
59 screenInfo
->bitmapScanlinePad
= BitmapPad(xnestDisplay
);
60 screenInfo
->bitmapBitOrder
= BitmapBitOrder(xnestDisplay
);
62 screenInfo
->numPixmapFormats
= 0;
63 for (i
= 0; i
< xnestNumPixmapFormats
; i
++)
64 for (j
= 0; j
< xnestNumDepths
; j
++)
65 if ((xnestPixmapFormats
[i
].depth
== 1) ||
66 (xnestPixmapFormats
[i
].depth
== xnestDepths
[j
])) {
67 screenInfo
->formats
[screenInfo
->numPixmapFormats
].depth
=
68 xnestPixmapFormats
[i
].depth
;
69 screenInfo
->formats
[screenInfo
->numPixmapFormats
].bitsPerPixel
=
70 xnestPixmapFormats
[i
].bits_per_pixel
;
71 screenInfo
->formats
[screenInfo
->numPixmapFormats
].scanlinePad
=
72 xnestPixmapFormats
[i
].scanline_pad
;
73 screenInfo
->numPixmapFormats
++;
77 xnestWindowPrivateIndex
= AllocateWindowPrivateIndex();
78 xnestGCPrivateIndex
= AllocateGCPrivateIndex();
79 xnestFontPrivateIndex
= AllocateFontPrivateIndex();
81 if (!xnestNumScreens
) xnestNumScreens
= 1;
83 for (i
= 0; i
< xnestNumScreens
; i
++)
84 AddScreen(xnestOpenScreen
, argc
, argv
);
86 xnestNumScreens
= screenInfo
->numScreens
;
88 xnestDoFullGeneration
= xnestFullGeneration
;
92 InitInput(int argc
, char *argv
[])
94 xnestPointerDevice
= AddInputDevice(xnestPointerProc
, TRUE
);
95 xnestKeyboardDevice
= AddInputDevice(xnestKeyboardProc
, TRUE
);
98 xnestEvents
= (xEvent
*) xcalloc(sizeof(xEvent
), GetMaximumEventsNum());
100 FatalError("couldn't allocate room for events\n");
102 RegisterPointerDevice(xnestPointerDevice
);
103 RegisterKeyboardDevice(xnestKeyboardDevice
);
107 AddEnabledDevice(XConnectionNumber(xnestDisplay
));
109 RegisterBlockAndWakeupHandlers(xnestBlockHandler
, xnestWakeupHandler
, NULL
);
113 * DDX - specific abort routine. Called by AbortServer().
117 xnestDoFullGeneration
= True
;
121 /* Called by GiveUp(). */
129 DarwinHandleGUI(int argc
, char *argv
[])
133 void GlxExtensionInit();
134 void GlxWrapInitVisuals(void *procPtr
);
137 DarwinGlxExtensionInit()
143 DarwinGlxWrapInitVisuals(
146 GlxWrapInitVisuals(procPtr
);
155 void OsVendorFatalError()
160 void ddxBeforeReset(void)
165 /* this is just to get the server to link on AIX */
167 int SelectWaitTime
= 10000; /* usec */