VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.4.2/xf86OSmouse.h@ 62425

最後變更 在這個檔案從62425是 43272,由 vboxsync 提交於 12 年 前

Additions/x11: more original X server headers.

  • 屬性 svn:eol-style 設為 native
檔案大小: 10.2 KB
 
1/*
2 * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
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
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Except as contained in this notice, the name of the copyright holder(s)
23 * and author(s) shall not be used in advertising or otherwise to promote
24 * the sale, use or other dealings in this Software without prior written
25 * authorization from the copyright holder(s) and author(s).
26 */
27
28/* Public interface to OS-specific mouse support. */
29
30#ifndef _XF86OSMOUSE_H_
31#define _XF86OSMOUSE_H_
32
33#include "xf86Xinput.h"
34
35/* Mouse interface classes */
36#define MSE_NONE 0x00
37#define MSE_SERIAL 0x01 /* serial port */
38#define MSE_BUS 0x02 /* old bus mouse */
39#define MSE_PS2 0x04 /* standard read-only PS/2 */
40#define MSE_XPS2 0x08 /* extended PS/2 */
41#define MSE_AUTO 0x10 /* auto-detect (PnP) */
42#define MSE_MISC 0x20 /* The OS layer will identify the
43 * specific protocol names that are
44 * supported for this class. */
45
46/* Mouse Protocol IDs. */
47typedef enum {
48 PROT_UNKNOWN = -2,
49 PROT_UNSUP = -1, /* protocol is not supported */
50 PROT_MS = 0,
51 PROT_MSC,
52 PROT_MM,
53 PROT_LOGI,
54 PROT_LOGIMAN,
55 PROT_MMHIT,
56 PROT_GLIDE,
57 PROT_IMSERIAL,
58 PROT_THINKING,
59 PROT_ACECAD,
60 PROT_VALUMOUSESCROLL,
61 PROT_PS2,
62 PROT_GENPS2,
63 PROT_IMPS2,
64 PROT_EXPPS2,
65 PROT_THINKPS2,
66 PROT_MMPS2,
67 PROT_GLIDEPS2,
68 PROT_NETPS2,
69 PROT_NETSCPS2,
70 PROT_BM,
71 PROT_AUTO,
72 PROT_SYSMOUSE,
73 PROT_NUMPROTOS /* This must always be last. */
74} MouseProtocolID;
75
76struct _MouseDevRec;
77
78typedef int (*GetInterfaceTypesProc)(void);
79typedef const char **(*BuiltinNamesProc)(void);
80typedef Bool (*CheckProtocolProc)(const char *protocol);
81typedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
82 int flags);
83typedef const char *(*DefaultProtocolProc)(void);
84typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
85typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
86 int res);
87typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
88 int flags);
89typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
90
91/*
92 * OSMouseInfoRec is used to pass information from the OSMouse layer to the
93 * OS-independent mouse driver.
94 */
95typedef struct {
96 GetInterfaceTypesProc SupportedInterfaces;
97 BuiltinNamesProc BuiltinNames;
98 CheckProtocolProc CheckProtocol;
99 BuiltinPreInitProc PreInit;
100 DefaultProtocolProc DefaultProtocol;
101 SetupAutoProc SetupAuto;
102 SetResProc SetPS2Res;
103 SetResProc SetBMRes;
104 SetResProc SetMiscRes;
105 FindDeviceProc FindDevice;
106 GuessProtocolProc GuessProtocol;
107} OSMouseInfoRec, *OSMouseInfoPtr;
108
109/*
110 * SupportedInterfaces: Returns the mouse interface types that the OS support.
111 * If MSE_MISC is returned, then the BuiltinNames and
112 * CheckProtocol should be set.
113 *
114 * BuiltinNames: Returns the names of the protocols that are fully handled
115 * in the OS-specific code. These are names that don't appear
116 * directly in the main "mouse" driver.
117 *
118 * CheckProtocol: Checks if the protocol name given is supported by the
119 * OS. It should return TRUE for both "builtin" protocols and
120 * protocols of type MSE_MISC that are supported by the OS.
121 *
122 * PreInit: The PreInit function for protocols that are builtin. This
123 * function is passed the protocol name.
124 *
125 * DefaultProtocol: Returns the name of a default protocol that should be used
126 * for the OS when none has been supplied in the config file.
127 * This should only be set when there is a reasonable default.
128 *
129 * SetupAuto: This function can be used to do OS-specific protocol
130 * auto-detection. It returns the name of the detected protocol,
131 * or NULL when detection fails. It may also adjust one or more
132 * of the "protoPara" values for the detected protocol by setting
133 * then to something other than -1. SetupAuto gets called in two
134 * ways. The first is before any devices have been opened. This
135 * can be used when the protocol "Auto" always maps to a single
136 * protocol type. The second is with the device open, allowing
137 * OS-specific probing to be done.
138 *
139 * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
140 * protocol types.
141 *
142 * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
143 *
144 * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
145 *
146 * FindDevice: This function gets called when no Device has been specified
147 * in the config file. OS-specific methods may be used to guess
148 * which input device to use. This function is called after the
149 * pre-open attempts at protocol discovery are done, but before
150 * the device is open. I.e., after the first SetupAuto() call,
151 * after the DefaultProtocol() call, but before the PreInit()
152 * call. Available protocol information may be used in locating
153 * the default input device.
154 *
155 * GuessProtocol: A last resort attempt at guessing the mouse protocol by
156 * whatever OS-specific means might be available. OS-independent
157 * things should be in the mouse driver. This function gets
158 * called after the mouse driver's OS-independent methods have
159 * failed.
160 */
161
162extern OSMouseInfoPtr xf86OSMouseInit(int flags);
163
164/* Adjust this when the mouse interface changes. */
165
166/*
167 * History:
168 *
169 * 1.0.0 - Everything up to when versioning was started.
170 * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
171 * 1.2.0 - xisbscale added to MouseDevRec
172 *
173 */
174
175#define OS_MOUSE_VERSION_MAJOR 1
176#define OS_MOUSE_VERSION_MINOR 2
177#define OS_MOUSE_VERSION_PATCH 0
178
179#define OS_MOUSE_VERSION_CURRENT \
180 BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
181 OS_MOUSE_VERSION_MINOR, \
182 OS_MOUSE_VERSION_PATCH)
183
184#define HAVE_GUESS_PROTOCOL \
185 (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
186 BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
187
188#define HAVE_FIND_DEVICE \
189 (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
190 BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
191
192/* Z axis mapping */
193#define MSE_NOZMAP 0
194#define MSE_MAPTOX -1
195#define MSE_MAPTOY -2
196#define MSE_MAPTOZ -3
197#define MSE_MAPTOW -4
198
199/* Generalize for other axes. */
200#define MSE_NOAXISMAP MSE_NOZMAP
201
202#define MSE_MAXBUTTONS 24
203#define MSE_DFLTBUTTONS 3
204
205/*
206 * Mouse device record. This is shared by the mouse driver and the OSMouse
207 * layer.
208 */
209
210typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
211typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
212typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
213typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
214
215typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
216 int dx, int dy, int dz, int dw);
217typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
218
219typedef struct _MouseDevRec {
220 PtrCtrlProcPtr Ctrl;
221 PostMseEventProc PostEvent;
222 MouseCommonOptProc CommonOptions;
223 DeviceIntPtr device;
224 const char * mseDevice;
225 const char * protocol;
226 MouseProtocolID protocolID;
227 MouseProtocolID oldProtocolID; /* hack */
228 int class;
229 int mseModel;
230 int baudRate;
231 int oldBaudRate;
232 int sampleRate;
233 int lastButtons;
234 int threshold; /* acceleration */
235 int num;
236 int den;
237 int buttons; /* # of buttons */
238 int emulateState; /* automata state for 2 button mode */
239 Bool emulate3Buttons;
240 Bool emulate3ButtonsSoft;
241 int emulate3Timeout;/* Timeout for 3 button emulation */
242 Bool chordMiddle;
243 Bool flipXY;
244 int invX;
245 int invY;
246 int mouseFlags; /* Flags to Clear after opening
247 * mouse dev */
248 int truebuttons; /* (not used)
249 * Arg to maintain before
250 * emulate3buttons timer callback */
251 int resolution;
252 int negativeZ; /* button mask */
253 int positiveZ; /* button mask */
254 int negativeW; /* button mask */
255 int positiveW; /* button mask */
256 pointer buffer; /* usually an XISBuffer* */
257 int protoBufTail;
258 unsigned char protoBuf[8];
259 unsigned char protoPara[8];
260 unsigned char inSync; /* driver in sync with datastream */
261 pointer mousePriv; /* private area */
262 InputInfoPtr pInfo;
263 int origProtocolID;
264 const char * origProtocol;
265 Bool emulate3Pending;/* timer waiting */
266 CARD32 emulate3Expires;/* time to fire emulation code */
267 Bool emulateWheel;
268 int wheelInertia;
269 int wheelButton;
270 int negativeX; /* Button values. Unlike the Z and */
271 int positiveX; /* W equivalents, these are button */
272 int negativeY; /* values rather than button masks. */
273 int positiveY;
274 int wheelYDistance;
275 int wheelXDistance;
276 Bool autoProbe;
277 checkMovementsProc checkMovements;
278 autoProbeProc autoProbeMouse;
279 collectDataProc collectData;
280 dataGoodProc dataGood;
281 int angleOffset;
282 pointer pDragLock; /* drag lock area */
283 int xisbscale; /* buffer size for 1 event */
284 int wheelButtonTimeout;/* Timeout for the wheel button emulation */
285 CARD32 wheelButtonExpires;
286 int doubleClickSourceButtonMask;
287 int doubleClickTargetButton;
288 int doubleClickTargetButtonMask;
289 int doubleClickOldSourceState;
290 int lastMappedButtons;
291 int buttonMap[MSE_MAXBUTTONS];
292} MouseDevRec, *MouseDevPtr;
293
294#endif /* _XF86OSMOUSE_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette