deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * copy of this software and associated documentation files (the "Software"),
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * to deal in the Software without restriction, including without limitation
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and/or sell copies of the Software, and to permit persons to whom the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Software is furnished to do so, subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice shall be included in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * all copies or substantial portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Except as contained in this notice, the name of the copyright holder(s)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and author(s) shall not be used in advertising or otherwise to promote
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the sale, use or other dealings in this Software without prior written
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * authorization from the copyright holder(s) and author(s).
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Public interface to OS-specific mouse support. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Mouse interface classes */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define MSE_MISC 0x20 /* The OS layer will identify the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * specific protocol names that are
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * supported for this class. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Mouse Protocol IDs. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*CheckProtocolProc)(const char *protocol);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OSMouseInfoRec is used to pass information from the OSMouse layer to the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OS-independent mouse driver.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SupportedInterfaces: Returns the mouse interface types that the OS support.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * If MSE_MISC is returned, then the BuiltinNames and
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * CheckProtocol should be set.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * BuiltinNames: Returns the names of the protocols that are fully handled
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * in the OS-specific code. These are names that don't appear
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * directly in the main "mouse" driver.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * CheckProtocol: Checks if the protocol name given is supported by the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OS. It should return TRUE for both "builtin" protocols and
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * protocols of type MSE_MISC that are supported by the OS.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * PreInit: The PreInit function for protocols that are builtin. This
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * function is passed the protocol name.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * DefaultProtocol: Returns the name of a default protocol that should be used
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * for the OS when none has been supplied in the config file.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This should only be set when there is a reasonable default.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SetupAuto: This function can be used to do OS-specific protocol
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * auto-detection. It returns the name of the detected protocol,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * or NULL when detection fails. It may also adjust one or more
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * of the "protoPara" values for the detected protocol by setting
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * then to something other than -1. SetupAuto gets called in two
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ways. The first is before any devices have been opened. This
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * can be used when the protocol "Auto" always maps to a single
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * protocol type. The second is with the device open, allowing
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OS-specific probing to be done.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * protocol types.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FindDevice: This function gets called when no Device has been specified
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * in the config file. OS-specific methods may be used to guess
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * which input device to use. This function is called after the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * pre-open attempts at protocol discovery are done, but before
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the device is open. I.e., after the first SetupAuto() call,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * after the DefaultProtocol() call, but before the PreInit()
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * call. Available protocol information may be used in locating
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the default input device.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * GuessProtocol: A last resort attempt at guessing the mouse protocol by
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * whatever OS-specific means might be available. OS-independent
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * things should be in the mouse driver. This function gets
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * called after the mouse driver's OS-independent methods have
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Adjust this when the mouse interface changes. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * 1.0.0 - Everything up to when versioning was started.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * 1.2.0 - xisbscale added to MouseDevRec
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Z axis mapping */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Generalize for other axes. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Mouse device record. This is shared by the mouse driver and the OSMouse
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*checkMovementsProc)(InputInfoPtr,int, int);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef Bool (*dataGoodProc)(struct _MouseDevRec *);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int emulateState; /* automata state for 2 button mode */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int emulate3Timeout;/* Timeout for 3 button emulation */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * mouse dev */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Arg to maintain before
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * emulate3buttons timer callback */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char inSync; /* driver in sync with datastream */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD32 emulate3Expires;/* time to fire emulation code */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int negativeX; /* Button values. Unlike the Z and */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int positiveX; /* W equivalents, these are button */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int negativeY; /* values rather than button masks. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int wheelButtonTimeout;/* Timeout for the wheel button emulation */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* _XF86OSMOUSE_H_ */