First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xprint / ddxInit.c
bloba465c4c6de6766401fe22c445897adee8bdac6f0
1 /*
2 (c) Copyright 1996 Hewlett-Packard Company
3 (c) Copyright 1996 International Business Machines Corp.
4 (c) Copyright 1996 Sun Microsystems, Inc.
5 (c) Copyright 1996 Novell, Inc.
6 (c) Copyright 1996 Digital Equipment Corp.
7 (c) Copyright 1996 Fujitsu Limited
8 (c) Copyright 1996 Hitachi, Ltd.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Except as contained in this notice, the names of the copyright holders shall
28 not be used in advertising or otherwise to promote the sale, use or other
29 dealings in this Software without prior written authorization from said
30 copyright holders.
33 #ifdef HAVE_DIX_CONFIG_H
34 #include <dix-config.h>
35 #endif
37 #include <X11/X.h>
38 #include <X11/Xos.h>
39 #include <X11/Xproto.h>
40 #include "windowstr.h"
41 #include "servermd.h"
42 #include "DiPrint.h"
44 /*-
45 *-----------------------------------------------------------------------
46 * InitOutput --
47 * If this is built as a print-only server, then we must supply
48 * an InitOutput routine. If a normal server's real ddx InitOutput
49 * is used, then it should call PrinterInitOutput if it so desires.
50 * The ddx-level hook is needed to allow the printer stuff to
51 * create additional screens. An extension can't reliably do
52 * this for two reasons:
54 * 1) If InitOutput doesn't create any screens, then main()
55 * exits before calling InitExtensions().
57 * 2) Other extensions may rely on knowing about all screens
58 * when they initialize, and we can't guarantee the order
59 * of extension initialization.
61 * Results:
62 * ScreenInfo filled in, and PrinterInitOutput is called to create
63 * the screens associated with printers.
65 * Side Effects:
66 * None
68 *-----------------------------------------------------------------------
71 void
72 InitOutput(
73 ScreenInfo *pScreenInfo,
74 int argc,
75 char **argv)
78 pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
79 pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
80 pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
81 pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
83 pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput */
84 screenInfo.numVideoScreens = 0;
86 #ifdef PRINT_ONLY_SERVER
87 PrinterInitOutput(pScreenInfo, argc, argv);
88 #endif
92 void
93 DDXRingBell(int volume, int pitch, int duration)
95 /* dummy func; link fails without */
98 static void
99 BellProc(
100 int volume,
101 DeviceIntPtr pDev)
103 return;
106 static void
107 KeyControlProc(
108 DeviceIntPtr pDev,
109 KeybdCtrl *ctrl)
111 return;
114 static KeySym printKeyMap[256];
115 static CARD8 printModMap[256];
117 static int
118 KeyboardProc(
119 DevicePtr pKbd,
120 int what,
121 int argc,
122 char *argv[])
124 KeySymsRec keySyms;
126 keySyms.minKeyCode = 8;
127 keySyms.maxKeyCode = 8;
128 keySyms.mapWidth = 1;
129 keySyms.map = printKeyMap;
131 switch(what)
133 case DEVICE_INIT:
134 InitKeyboardDeviceStruct(pKbd, &keySyms, printModMap,
135 (BellProcPtr)BellProc,
136 KeyControlProc);
137 break;
138 case DEVICE_ON:
139 break;
140 case DEVICE_OFF:
141 break;
142 case DEVICE_CLOSE:
143 break;
145 return Success;
148 #include "../mi/mipointer.h"
149 static int
150 PointerProc(
151 DevicePtr pPtr,
152 int what,
153 int argc,
154 char *argv[])
156 #define NUM_BUTTONS 1
157 CARD8 map[NUM_BUTTONS];
159 switch(what)
161 case DEVICE_INIT:
163 map[0] = 0;
164 InitPointerDeviceStruct(pPtr, map, NUM_BUTTONS,
165 GetMotionHistory,
166 (PtrCtrlProcPtr)_XpVoidNoop,
167 GetMotionHistorySize(), 2);
168 break;
170 case DEVICE_ON:
171 break;
172 case DEVICE_OFF:
173 break;
174 case DEVICE_CLOSE:
175 break;
177 return Success;
180 void
181 InitInput(
182 int argc,
183 char **argv)
185 DeviceIntPtr ptr, kbd;
187 ptr = AddInputDevice((DeviceProc)PointerProc, TRUE);
188 kbd = AddInputDevice((DeviceProc)KeyboardProc, TRUE);
189 RegisterPointerDevice(ptr);
190 RegisterKeyboardDevice(kbd);
191 return;
195 Bool
196 LegalModifier(
197 unsigned int key,
198 DeviceIntPtr dev)
200 return TRUE;
203 void
204 ProcessInputEvents(void)
208 #ifdef __DARWIN__
209 #include "micmap.h"
211 void GlxExtensionInit(void);
212 void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr);
214 void
215 DarwinHandleGUI(int argc, char *argv[])
219 void DarwinGlxExtensionInit(void)
221 GlxExtensionInit();
224 void DarwinGlxWrapInitVisuals(
225 miInitVisualsProcPtr *procPtr)
227 GlxWrapInitVisuals(procPtr);
229 #endif
231 #ifdef DDXOSINIT
232 void
233 OsVendorInit(void)
236 #endif
238 #ifdef DDXOSFATALERROR
239 void
240 OsVendorFatalError(void)
243 #endif
245 #ifdef DDXBEFORERESET
246 void
247 ddxBeforeReset(void)
249 return;
251 #endif
253 /* ddxInitGlobals - called by |InitGlobals| from os/util.c */
254 void ddxInitGlobals(void)
256 PrinterInitGlobals();
259 /****************************************
260 * ddxUseMsg()
262 * Called my usemsg from os/utils/c
264 *****************************************/
266 void ddxUseMsg(void)
270 void AbortDDX (void)
274 void ddxGiveUp(void) /* Called by GiveUp() */
279 ddxProcessArgument (
280 int argc,
281 char *argv[],
282 int i)
284 return(0);
287 #ifdef XINPUT
289 #include <X11/extensions/XI.h>
290 #include <X11/extensions/XIproto.h>
291 #include "XIstubs.h"
292 #include "exglobals.h"
295 ChangePointerDevice (
296 DeviceIntPtr old_dev,
297 DeviceIntPtr new_dev,
298 unsigned char x,
299 unsigned char y)
301 return (BadDevice);
305 ChangeDeviceControl (
306 register ClientPtr client,
307 DeviceIntPtr dev,
308 xDeviceCtl *control)
310 return BadMatch;
313 void
314 OpenInputDevice (
315 DeviceIntPtr dev,
316 ClientPtr client,
317 int *status)
319 return;
322 void
323 AddOtherInputDevices (void)
325 return;
328 void
329 CloseInputDevice (
330 DeviceIntPtr dev,
331 ClientPtr client)
333 return;
337 ChangeKeyboardDevice (
338 DeviceIntPtr old_dev,
339 DeviceIntPtr new_dev)
341 return (Success);
345 SetDeviceMode (
346 register ClientPtr client,
347 DeviceIntPtr dev,
348 int mode)
350 return BadMatch;
354 SetDeviceValuators (
355 register ClientPtr client,
356 DeviceIntPtr dev,
357 int *valuators,
358 int first_valuator,
359 int num_valuators)
361 return BadMatch;
365 #endif /* XINPUT */
367 #ifdef AIXV3
369 * This is just to get the server to link on AIX, where some bits
370 * that should be in os/ are instead in hw/ibm.
372 int SelectWaitTime = 10000; /* usec */
373 #endif