1 /************************************************************
3 Copyright 1989, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
25 Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
29 Permission to use, copy, modify, and distribute this software and its
30 documentation for any purpose and without fee is hereby granted,
31 provided that the above copyright notice appear in all copies and that
32 both that copyright notice and this permission notice appear in
33 supporting documentation, and that the name of Hewlett-Packard not be
34 used in advertising or publicity pertaining to distribution of the
35 software without specific, written prior permission.
37 HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39 HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
40 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45 ********************************************************/
48 * stubs.c -- stub routines for the X server side of the XINPUT
49 * extension. This file is mainly to be used only as documentation.
50 * There is not much code here, and you can't get a working XINPUT
51 * server just using this.
52 * The Xvfb server uses this file so it will compile with the same
53 * object files as the real X server for a platform that has XINPUT.
54 * Xnest could do the same thing.
58 #ifdef HAVE_DIX_CONFIG_H
59 #include <dix-config.h>
63 #include <X11/Xproto.h>
65 #include <X11/extensions/XI.h>
66 #include <X11/extensions/XIproto.h>
69 /***********************************************************************
71 * Caller: ProcXCloseDevice
73 * Take care of implementation-dependent details of closing a device.
74 * Some implementations may actually close the device, others may just
75 * remove this clients interest in that device.
77 * The default implementation is to do nothing (assume all input devices
78 * are initialized during X server initialization and kept open).
83 CloseInputDevice(DeviceIntPtr d
, ClientPtr client
)
87 /***********************************************************************
89 * Caller: ProcXListInputDevices
91 * This is the implementation-dependent routine to initialize an input
92 * device to the point that information about it can be listed.
93 * Some implementations open all input devices when the server is first
94 * initialized, and never close them. Other implementations open only
95 * the X pointer and keyboard devices during server initialization,
96 * and only open other input devices when some client makes an
97 * XOpenDevice request. If some other process has the device open, the
98 * server may not be able to get information about the device to list it.
100 * This procedure should be used by implementations that do not initialize
101 * all input devices at server startup. It should do device-dependent
102 * initialization for any devices not previously initialized, and call
103 * AddInputDevice for each of those devices so that a DeviceIntRec will be
106 * The default implementation is to do nothing (assume all input devices
107 * are initialized during X server initialization and kept open).
108 * The commented-out sample code shows what you might do if you don't want
114 AddOtherInputDevices(void)
116 /**********************************************************************
117 for each uninitialized device, do something like:
120 DeviceProc deviceProc;
123 dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
124 dev->public.devicePrivate = private;
125 RegisterOtherDevice(dev);
126 dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
127 ************************************************************************/
131 /***********************************************************************
133 * Caller: ProcXOpenDevice
135 * This is the implementation-dependent routine to open an input device.
136 * Some implementations open all input devices when the server is first
137 * initialized, and never close them. Other implementations open only
138 * the X pointer and keyboard devices during server initialization,
139 * and only open other input devices when some client makes an
140 * XOpenDevice request. This entry point is for the latter type of
143 * If the physical device is not already open, do it here. In this case,
144 * you need to keep track of the fact that one or more clients has the
145 * device open, and physically close it when the last client that has
146 * it open does an XCloseDevice.
148 * The default implementation is to do nothing (assume all input devices
149 * are opened during X server initialization and kept open).
154 OpenInputDevice(DeviceIntPtr dev
, ClientPtr client
, int *status
)
158 /****************************************************************************
160 * Caller: ProcXSetDeviceMode
162 * Change the mode of an extension device.
163 * This function is used to change the mode of a device from reporting
164 * relative motion to reporting absolute positional information, and
166 * The default implementation below is that no such devices are supported.
171 SetDeviceMode(ClientPtr client
, DeviceIntPtr dev
, int mode
)
176 /****************************************************************************
178 * Caller: ProcXSetDeviceValuators
180 * Set the value of valuators on an extension input device.
181 * This function is used to set the initial value of valuators on
182 * those input devices that are capable of reporting either relative
183 * motion or an absolute position, and allow an initial position to be set.
184 * The default implementation below is that no such devices are supported.
189 SetDeviceValuators(ClientPtr client
, DeviceIntPtr dev
,
190 int *valuators
, int first_valuator
, int num_valuators
)
195 /****************************************************************************
197 * Caller: ProcXChangeDeviceControl
199 * Change the specified device controls on an extension input device.
204 ChangeDeviceControl(ClientPtr client
, DeviceIntPtr dev
,
205 xDeviceCtl
* control
)
207 switch (control
->control
) {
208 case DEVICE_RESOLUTION
:
210 case DEVICE_ABS_CALIB
:
211 case DEVICE_ABS_AREA
:
221 /****************************************************************************
223 * Caller: configAddDevice (and others)
225 * Add a new device with the specified options.
229 NewInputDeviceRequest(InputOption
*options
, DeviceIntPtr
*pdev
)
234 /****************************************************************************
236 * Caller: configRemoveDevice (and others)
238 * Remove the specified device previously added.
242 DeleteInputDeviceRequest(DeviceIntPtr dev
)