|
|
|
|
File: [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / os-support / xf86OSmouse.h
(download)
Revision: 1.27, Thu Feb 17 01:41:27 2005 UTC (8 years, 4 months ago) by dawes Branch: MAIN CVS Tags: xf-4_8_0-bindist, xf-4_8_0, xf-4_8-branch, xf-4_7_99_9, xf-4_7_99_8, xf-4_7_99_7, xf-4_7_99_6, xf-4_7_99_5, xf-4_7_99_4, xf-4_7_99_31, xf-4_7_99_30, xf-4_7_99_3, xf-4_7_99_29, xf-4_7_99_28, xf-4_7_99_27, xf-4_7_99_26, xf-4_7_99_25, xf-4_7_99_24, xf-4_7_99_23, xf-4_7_99_22, xf-4_7_99_21, xf-4_7_99_20, xf-4_7_99_2, xf-4_7_99_19, xf-4_7_99_18, xf-4_7_99_17, xf-4_7_99_16, xf-4_7_99_15, xf-4_7_99_14, xf-4_7_99_13, xf-4_7_99_12, xf-4_7_99_11, xf-4_7_99_10, xf-4_7_99_1, xf-4_7_0, xf-4_7-branch, xf-4_6_99_9, xf-4_6_99_8, xf-4_6_99_7, xf-4_6_99_6, xf-4_6_99_5, xf-4_6_99_4, xf-4_6_99_3, xf-4_6_99_29, xf-4_6_99_28, xf-4_6_99_27, xf-4_6_99_26, xf-4_6_99_25, xf-4_6_99_24, xf-4_6_99_23, xf-4_6_99_22, xf-4_6_99_21, xf-4_6_99_20, xf-4_6_99_2, xf-4_6_99_19, xf-4_6_99_18, xf-4_6_99_17, xf-4_6_99_16, xf-4_6_99_15, xf-4_6_99_14, xf-4_6_99_13, xf-4_6_99_12, xf-4_6_99_11, xf-4_6_99_10, xf-4_6_99_1, xf-4_6_0, xf-4_6-branch, xf-4_5_99_904, xf-4_5_99_903, xf-4_5_99_902, xf-4_5_99_901, xf-4_5_99_9, xf-4_5_99_8, xf-4_5_99_7, xf-4_5_99_6, xf-4_5_99_5, xf-4_5_99_4, xf-4_5_99_3, xf-4_5_99_22, xf-4_5_99_21, xf-4_5_99_20, xf-4_5_99_2, xf-4_5_99_19, xf-4_5_99_18, xf-4_5_99_17, xf-4_5_99_16, xf-4_5_99_15, xf-4_5_99_14, xf-4_5_99_13, xf-4_5_99_12, xf-4_5_99_11, xf-4_5_99_10, xf-4_5_99_1, xf-4_5_0, xf-4_5-branch, xf-4_4_99_903, xf-4_4_99_902, HEAD Changes since 1.26: +2 -2 lines 332. Increase MSE_MAXBUTTONS from 12 to 24 (Bugzilla #1536, Julian Cable). |
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.26 2004/07/21 20:27:59 herrb Exp $ */
/*
* Copyright (c) 1999-2003 by The XFree86 Project, Inc.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution, and in the same place and form as other copyright,
* license and disclaimer information.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment: "This product
* includes software developed by The XFree86 Project, Inc
* (http://www.xfree86.org/) and its contributors", in the same
* place and form as other third-party acknowledgments. Alternately,
* this acknowledgment may appear in the software itself, in the
* same form and location as other such third-party acknowledgments.
*
* 4. Except as contained in this notice, the name of The XFree86
* Project, Inc shall not be used in advertising or otherwise to
* promote the sale, use or other dealings in this Software without
* prior written authorization from The XFree86 Project, Inc.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Public interface to OS-specific mouse support. */
#ifndef _XF86OSMOUSE_H_
#define _XF86OSMOUSE_H_
#include "xf86Xinput.h"
/* Mouse interface classes */
#define MSE_NONE 0x00
#define MSE_SERIAL 0x01 /* serial port */
#define MSE_BUS 0x02 /* old bus mouse */
#define MSE_PS2 0x04 /* standard read-only PS/2 */
#define MSE_XPS2 0x08 /* extended PS/2 */
#define MSE_AUTO 0x10 /* auto-detect (PnP) */
#define MSE_MISC 0x20 /* The OS layer will identify the
* specific protocol names that are
* supported for this class. */
/* Mouse Protocol IDs. */
typedef enum {
PROT_UNKNOWN = -2,
PROT_UNSUP = -1, /* protocol is not supported */
PROT_MS = 0,
PROT_MSC,
PROT_MM,
PROT_LOGI,
PROT_LOGIMAN,
PROT_MMHIT,
PROT_GLIDE,
PROT_IMSERIAL,
PROT_THINKING,
PROT_ACECAD,
PROT_VALUMOUSESCROLL,
PROT_PS2,
PROT_GENPS2,
PROT_IMPS2,
PROT_EXPPS2,
PROT_THINKPS2,
PROT_MMPS2,
PROT_GLIDEPS2,
PROT_NETPS2,
PROT_NETSCPS2,
PROT_BM,
PROT_AUTO,
PROT_SYSMOUSE,
PROT_NUMPROTOS /* This must always be last. */
} MouseProtocolID;
struct _MouseDevRec;
typedef int (*GetInterfaceTypesProc)(void);
typedef const char **(*BuiltinNamesProc)(void);
typedef Bool (*CheckProtocolProc)(const char *protocol);
typedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
int flags);
typedef const char *(*DefaultProtocolProc)(void);
typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
int res);
typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
int flags);
typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
/*
* OSMouseInfoRec is used to pass information from the OSMouse layer to the
* OS-independent mouse driver.
*/
typedef struct {
GetInterfaceTypesProc SupportedInterfaces;
BuiltinNamesProc BuiltinNames;
CheckProtocolProc CheckProtocol;
BuiltinPreInitProc PreInit;
DefaultProtocolProc DefaultProtocol;
SetupAutoProc SetupAuto;
SetResProc SetPS2Res;
SetResProc SetBMRes;
SetResProc SetMiscRes;
FindDeviceProc FindDevice;
GuessProtocolProc GuessProtocol;
} OSMouseInfoRec, *OSMouseInfoPtr;
/*
* 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. SetupAuto gets called in two
* ways. The first is before any devices have been opened. This
* can be used when the protocol "Auto" always maps to a single
* protocol type. The second is with the device open, allowing
* OS-specific probing to be done.
*
* 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.
*
* FindDevice: This function gets called when no Device has been specified
* in the config file. OS-specific methods may be used to guess
* which input device to use. This function is called after the
* pre-open attempts at protocol discovery are done, but before
* the device is open. I.e., after the first SetupAuto() call,
* after the DefaultProtocol() call, but before the PreInit()
* call. Available protocol information may be used in locating
* the default input device.
*
* GuessProtocol: A last resort attempt at guessing the mouse protocol by
* whatever OS-specific means might be available. OS-independent
* things should be in the mouse driver. This function gets
* called after the mouse driver's OS-independent methods have
* failed.
*/
extern OSMouseInfoPtr xf86OSMouseInit(int flags);
/* Adjust this when the mouse interface changes. */
/*
* History:
*
* 1.0.0 - Everything up to when versioning was started.
* 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
* 1.2.0 - xisbscale added to MouseDevRec
*
*/
#define OS_MOUSE_VERSION_MAJOR 1
#define OS_MOUSE_VERSION_MINOR 2
#define OS_MOUSE_VERSION_PATCH 0
#define OS_MOUSE_VERSION_CURRENT \
BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
OS_MOUSE_VERSION_MINOR, \
OS_MOUSE_VERSION_PATCH)
#define HAVE_GUESS_PROTOCOL \
(xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
#define HAVE_FIND_DEVICE \
(xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
/*
* Mouse device record. This is shared by the mouse driver and the OSMouse
* layer.
*/
typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
int dx, int dy, int dz, int dw);
typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
typedef struct _MouseDevRec {
PtrCtrlProcPtr Ctrl;
PostMseEventProc PostEvent;
MouseCommonOptProc CommonOptions;
DeviceIntPtr device;
const char * mseDevice;
const char * protocol;
MouseProtocolID protocolID;
MouseProtocolID 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 */
Bool emulate3Buttons;
Bool emulate3ButtonsSoft;
int emulate3Timeout;/* Timeout for 3 button emulation */
Bool chordMiddle;
Bool flipXY;
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 */
pointer buffer; /* usually an XISBuffer* */
int protoBufTail;
unsigned char protoBuf[8];
unsigned char protoPara[8];
unsigned char inSync; /* driver in sync with datastream */
pointer mousePriv; /* private area */
InputInfoPtr pInfo;
int origProtocolID;
const char * origProtocol;
Bool emulate3Pending;/* timer waiting */
CARD32 emulate3Expires;/* time to fire emulation code */
Bool emulateWheel;
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;
Bool autoProbe;
checkMovementsProc checkMovements;
autoProbeProc autoProbeMouse;
collectDataProc collectData;
dataGoodProc dataGood;
int angleOffset;
pointer pDragLock; /* drag lock area */
int xisbscale; /* buffer size for 1 event */
} 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 24
#define MSE_DFLTBUTTONS 3
#endif /* _XF86OSMOUSE_H_ */
|
Powered by ViewCVS 0.9.2 |