xf86OSmouse.h revision a2760a4d593af57a19ec32cdfd1723b68495df8c
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.16 2001/08/06 20:51:10 dawes Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
*/
/* Public interface to OS-specific mouse support. */
#ifndef _XF86OSMOUSE_H_
#define _XF86OSMOUSE_H_
#include "xf86Xinput.h"
/* Mouse interface classes */
#define MSE_NONE 0x00
* specific protocol names that are
* supported for this class. */
typedef int (*GetInterfaceTypesProc)(void);
typedef const char **(*BuiltinNamesProc)(void);
int flags);
typedef const char *(*DefaultProtocolProc)(void);
int res);
/*
* OSMouseInfoRec is used to pass information from the OSMouse layer to the
* OS-independent mouse driver.
*/
typedef struct {
/*
* SupportedInterfaces: Returns the mouse interface types that the OS support.
* If MSE_MISC is returned, then the BuiltinNames and
* CheckProtocol should be set.
*
* BuiltinNames: Returns the names of the protocols that are fully handled
* in the OS-specific code. These are names that don't appear
* directly in the main "mouse" driver.
*
* CheckProtocol: Checks if the protocol name given is supported by the
* OS. It should return TRUE for both "builtin" protocols and
* protocols of type MSE_MISC that are supported by the OS.
*
* PreInit: The PreInit function for protocols that are builtin. This
* function is passed the protocol name.
*
* DefaultProtocol: Returns the name of a default protocol that should be used
* for the OS when none has been supplied in the config file.
* This should only be set when there is a reasonable default.
*
* SetupAuto: This function can be used to do OS-specific protocol
* auto-detection. It returns the name of the detected protocol,
* or NULL when detection fails. It may also adjust one or more
* of the "protoPara" values for the detected protocol by setting
* then to something other than -1.
*
* SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
* protocol types.
*
* SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
*
* SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
*/
/*
* Mouse device record. This is shared by the mouse driver and the OSMouse
* layer.
*/
typedef struct _MouseDevRec {
const char * mseDevice;
const char * protocol;
int protocolID;
int oldProtocolID; /* hack */
int class;
int mseModel;
int baudRate;
int oldBaudRate;
int sampleRate;
int lastButtons;
int threshold; /* acceleration */
int num;
int den;
int buttons; /* # of buttons */
int emulateState; /* automata state for 2 button mode */
int emulate3Timeout;/* Timeout for 3 button emulation */
int invX;
int invY;
int mouseFlags; /* Flags to Clear after opening
* mouse dev */
int truebuttons; /* (not used)
* Arg to maintain before
* emulate3buttons timer callback */
int resolution;
int negativeZ; /* button mask */
int positiveZ; /* button mask */
int negativeW; /* button mask */
int positiveW; /* button mask */
int protoBufTail;
unsigned char protoBuf[8];
unsigned char protoPara[8];
unsigned char inSync; /* driver in sync with datastream */
int origProtocolID;
const char * origProtocol;
int wheelInertia;
int wheelButtonMask;
int negativeX; /* Button values. Unlike the Z and */
int positiveX; /* W equivalents, these are button */
int negativeY; /* values rather than button masks. */
int positiveY;
int wheelYDistance;
int wheelXDistance;
} MouseDevRec, *MouseDevPtr;
/* Z axis mapping */
#define MSE_NOZMAP 0
#define MSE_MAPTOX -1
#define MSE_MAPTOY -2
#define MSE_MAPTOZ -3
#define MSE_MAPTOW -4
/* Generalize for other axes. */
#define MSE_NOAXISMAP MSE_NOZMAP
#define MSE_MAXBUTTONS 12
#define MSE_DFLTBUTTONS 3
#endif /* _XF86OSMOUSE_H_ */