040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Permission is hereby granted, free of charge, to any person obtaining a
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * copy of this software and associated documentation files (the "Software"),
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * to deal in the Software without restriction, including without limitation
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * and/or sell copies of the Software, and to permit persons to whom the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Software is furnished to do so, subject to the following conditions:
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * The above copyright notice and this permission notice shall be included in
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * all copies or substantial portions of the Software.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OTHER DEALINGS IN THE SOFTWARE.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Except as contained in this notice, the name of the copyright holder(s)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * and author(s) shall not be used in advertising or otherwise to promote
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * the sale, use or other dealings in this Software without prior written
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * authorization from the copyright holder(s) and author(s).
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Public interface to OS-specific mouse support. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#ifndef _XF86OSMOUSE_H_
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define _XF86OSMOUSE_H_
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#include "xf86Xinput.h"
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Mouse interface classes */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_NONE 0x00
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_SERIAL 0x01 /* serial port */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_BUS 0x02 /* old bus mouse */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_PS2 0x04 /* standard read-only PS/2 */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_XPS2 0x08 /* extended PS/2 */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_AUTO 0x10 /* auto-detect (PnP) */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MISC 0x20 /* The OS layer will identify the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * specific protocol names that are
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * supported for this class. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Mouse Protocol IDs. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef enum {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_UNKNOWN = -2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_UNSUP = -1, /* protocol is not supported */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_MS = 0,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_MSC,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_MM,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_LOGI,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_LOGIMAN,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_MMHIT,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_GLIDE,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_IMSERIAL,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_THINKING,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_ACECAD,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_VALUMOUSESCROLL,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_PS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_GENPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_IMPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_EXPPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_THINKPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_MMPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_GLIDEPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_NETPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_NETSCPS2,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_BM,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_AUTO,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_SYSMOUSE,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PROT_NUMPROTOS /* This must always be last. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} MouseProtocolID;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstruct _MouseDevRec;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef int (*GetInterfaceTypesProc)(void);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef const char **(*BuiltinNamesProc)(void);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef Bool (*CheckProtocolProc)(const char *protocol);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef const char *(*DefaultProtocolProc)(void);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int res);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OSMouseInfoRec is used to pass information from the OSMouse layer to the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OS-independent mouse driver.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef struct {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync GetInterfaceTypesProc SupportedInterfaces;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync BuiltinNamesProc BuiltinNames;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync CheckProtocolProc CheckProtocol;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync BuiltinPreInitProc PreInit;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DefaultProtocolProc DefaultProtocol;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync SetupAutoProc SetupAuto;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync SetResProc SetPS2Res;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync SetResProc SetBMRes;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync SetResProc SetMiscRes;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync FindDeviceProc FindDevice;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync GuessProtocolProc GuessProtocol;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} OSMouseInfoRec, *OSMouseInfoPtr;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * SupportedInterfaces: Returns the mouse interface types that the OS support.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * If MSE_MISC is returned, then the BuiltinNames and
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * CheckProtocol should be set.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * BuiltinNames: Returns the names of the protocols that are fully handled
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * in the OS-specific code. These are names that don't appear
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * directly in the main "mouse" driver.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * CheckProtocol: Checks if the protocol name given is supported by the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OS. It should return TRUE for both "builtin" protocols and
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * protocols of type MSE_MISC that are supported by the OS.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * PreInit: The PreInit function for protocols that are builtin. This
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * function is passed the protocol name.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * DefaultProtocol: Returns the name of a default protocol that should be used
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * for the OS when none has been supplied in the config file.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * This should only be set when there is a reasonable default.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * SetupAuto: This function can be used to do OS-specific protocol
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * auto-detection. It returns the name of the detected protocol,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * or NULL when detection fails. It may also adjust one or more
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * of the "protoPara" values for the detected protocol by setting
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * then to something other than -1. SetupAuto gets called in two
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * ways. The first is before any devices have been opened. This
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * can be used when the protocol "Auto" always maps to a single
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * protocol type. The second is with the device open, allowing
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OS-specific probing to be done.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * protocol types.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * FindDevice: This function gets called when no Device has been specified
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * in the config file. OS-specific methods may be used to guess
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * which input device to use. This function is called after the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * pre-open attempts at protocol discovery are done, but before
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * the device is open. I.e., after the first SetupAuto() call,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * after the DefaultProtocol() call, but before the PreInit()
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * call. Available protocol information may be used in locating
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * the default input device.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * GuessProtocol: A last resort attempt at guessing the mouse protocol by
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * whatever OS-specific means might be available. OS-independent
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * things should be in the mouse driver. This function gets
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * called after the mouse driver's OS-independent methods have
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * failed.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncextern OSMouseInfoPtr xf86OSMouseInit(int flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Adjust this when the mouse interface changes. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * History:
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * 1.0.0 - Everything up to when versioning was started.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * 1.2.0 - xisbscale added to MouseDevRec
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define OS_MOUSE_VERSION_MAJOR 1
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define OS_MOUSE_VERSION_MINOR 2
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define OS_MOUSE_VERSION_PATCH 0
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define OS_MOUSE_VERSION_CURRENT \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync OS_MOUSE_VERSION_MINOR, \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync OS_MOUSE_VERSION_PATCH)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define HAVE_GUESS_PROTOCOL \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define HAVE_FIND_DEVICE \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Z axis mapping */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_NOZMAP 0
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MAPTOX -1
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MAPTOY -2
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MAPTOZ -3
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MAPTOW -4
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Generalize for other axes. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_NOAXISMAP MSE_NOZMAP
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_MAXBUTTONS 24
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define MSE_DFLTBUTTONS 3
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Mouse device record. This is shared by the mouse driver and the OSMouse
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * layer.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*checkMovementsProc)(InputInfoPtr,int, int);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef Bool (*dataGoodProc)(struct _MouseDevRec *);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int dx, int dy, int dz, int dw);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef struct _MouseDevRec {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PtrCtrlProcPtr Ctrl;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync PostMseEventProc PostEvent;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync MouseCommonOptProc CommonOptions;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DeviceIntPtr device;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync const char * mseDevice;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync const char * protocol;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync MouseProtocolID protocolID;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync MouseProtocolID oldProtocolID; /* hack */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int class;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int mseModel;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int baudRate;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int oldBaudRate;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int sampleRate;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int lastButtons;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int threshold; /* acceleration */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int num;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int den;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int buttons; /* # of buttons */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int emulateState; /* automata state for 2 button mode */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool emulate3Buttons;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool emulate3ButtonsSoft;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int emulate3Timeout;/* Timeout for 3 button emulation */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool chordMiddle;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool flipXY;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int invX;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int invY;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int mouseFlags; /* Flags to Clear after opening
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * mouse dev */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int truebuttons; /* (not used)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Arg to maintain before
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * emulate3buttons timer callback */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int resolution;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int negativeZ; /* button mask */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int positiveZ; /* button mask */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int negativeW; /* button mask */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int positiveW; /* button mask */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync pointer buffer; /* usually an XISBuffer* */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int protoBufTail;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned char protoBuf[8];
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned char protoPara[8];
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned char inSync; /* driver in sync with datastream */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync pointer mousePriv; /* private area */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync InputInfoPtr pInfo;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int origProtocolID;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync const char * origProtocol;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool emulate3Pending;/* timer waiting */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync CARD32 emulate3Expires;/* time to fire emulation code */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool emulateWheel;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int wheelInertia;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int wheelButton;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int negativeX; /* Button values. Unlike the Z and */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int positiveX; /* W equivalents, these are button */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int negativeY; /* values rather than button masks. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int positiveY;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int wheelYDistance;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int wheelXDistance;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync Bool autoProbe;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync checkMovementsProc checkMovements;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync autoProbeProc autoProbeMouse;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync collectDataProc collectData;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync dataGoodProc dataGood;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int angleOffset;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync pointer pDragLock; /* drag lock area */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int xisbscale; /* buffer size for 1 event */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int wheelButtonTimeout;/* Timeout for the wheel button emulation */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync CARD32 wheelButtonExpires;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int doubleClickSourceButtonMask;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int doubleClickTargetButton;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int doubleClickTargetButtonMask;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int doubleClickOldSourceState;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int lastMappedButtons;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int buttonMap[MSE_MAXBUTTONS];
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} MouseDevRec, *MouseDevPtr;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#endif /* _XF86OSMOUSE_H_ */