1 | /* $XFree86$ */
|
---|
2 | /*
|
---|
3 | * Copyright 2002 Red Hat Inc., Durham, North Carolina.
|
---|
4 | *
|
---|
5 | * All Rights Reserved.
|
---|
6 | *
|
---|
7 | * Permission is hereby granted, free of charge, to any person obtaining
|
---|
8 | * a copy of this software and associated documentation files (the
|
---|
9 | * "Software"), to deal in the Software without restriction, including
|
---|
10 | * without limitation on the rights to use, copy, modify, merge,
|
---|
11 | * publish, distribute, sublicense, and/or sell copies of the Software,
|
---|
12 | * and to permit persons to whom the Software is furnished to do so,
|
---|
13 | * subject to the following conditions:
|
---|
14 | *
|
---|
15 | * The above copyright notice and this permission notice (including the
|
---|
16 | * next paragraph) shall be included in all copies or substantial
|
---|
17 | * portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
22 | * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
|
---|
23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
---|
24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
---|
26 | * SOFTWARE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * Authors:
|
---|
31 | * Rickard E. (Rik) Faith <[email protected]>
|
---|
32 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | /** \file
|
---|
36 | * Private header file for USB support. This file provides
|
---|
37 | * Linux-specific include files and the definition of the private
|
---|
38 | * structure. \see usb-common.c \see usb-keyboard.c \see usb-mouse.c
|
---|
39 | * \see usb-other.c */
|
---|
40 |
|
---|
41 | #ifndef _USB_PRIVATE_H_
|
---|
42 | #define _USB_PRIVATE_H_
|
---|
43 |
|
---|
44 | #include "dmxinputinit.h"
|
---|
45 | #include "inputstr.h"
|
---|
46 | #include <X11/Xos.h>
|
---|
47 | #include <errno.h>
|
---|
48 | #include <linux/input.h>
|
---|
49 | #include "usb-common.h"
|
---|
50 |
|
---|
51 | /* Support for force feedback was
|
---|
52 | * introduced in Linxu 2.4.10 */
|
---|
53 | #ifndef EV_MSC
|
---|
54 | #define EV_MSC 0x04
|
---|
55 | #endif
|
---|
56 | #ifndef EV_FF
|
---|
57 | #define EV_FF 0x15
|
---|
58 | #endif
|
---|
59 | #ifndef LED_SLEEP
|
---|
60 | #define LED_SLEEP 0x05
|
---|
61 | #endif
|
---|
62 | #ifndef LED_SUSPEND
|
---|
63 | #define LED_SUSPEND 0x06
|
---|
64 | #endif
|
---|
65 | #ifndef LED_MUTE
|
---|
66 | #define LED_MUTE 0x07
|
---|
67 | #endif
|
---|
68 | #ifndef LED_MISC
|
---|
69 | #define LED_MISC 0x08
|
---|
70 | #endif
|
---|
71 | #ifndef BTN_DEAD
|
---|
72 | #define BTN_DEAD 0x12f
|
---|
73 | #endif
|
---|
74 | #ifndef BTN_THUMBL
|
---|
75 | #define BTN_THUMBL 0x13d
|
---|
76 | #endif
|
---|
77 | #ifndef BTN_THUMBR
|
---|
78 | #define BTN_THUMBR 0x13e
|
---|
79 | #endif
|
---|
80 | #ifndef MSC_SERIAL
|
---|
81 | #define MSC_SERIAL 0x00
|
---|
82 | #endif
|
---|
83 | #ifndef MSC_MAX
|
---|
84 | #define MSC_MAX 0x07
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | /* Support for older kernels. */
|
---|
88 | #ifndef ABS_WHEEL
|
---|
89 | #define ABS_WHEEL 0x08
|
---|
90 | #endif
|
---|
91 | #ifndef ABS_GAS
|
---|
92 | #define ABS_GAS 0x09
|
---|
93 | #endif
|
---|
94 | #ifndef ABS_BRAKE
|
---|
95 | #define ABS_BRAKE 0x0a
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | #define NUM_STATE_ENTRIES (256/32)
|
---|
99 |
|
---|
100 | /* Private area for USB devices. */
|
---|
101 | typedef struct _myPrivate {
|
---|
102 | DeviceIntPtr pDevice; /**< Device (mouse or other) */
|
---|
103 | int fd; /**< File descriptor */
|
---|
104 | unsigned char mask[EV_MAX/8 + 1]; /**< Mask */
|
---|
105 | int numRel, numAbs, numLeds; /**< Counts */
|
---|
106 | int relmap[DMX_MAX_AXES]; /**< Relative axis map */
|
---|
107 | int absmap[DMX_MAX_AXES]; /**< Absolute axis map */
|
---|
108 |
|
---|
109 | CARD32 kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */
|
---|
110 | DeviceIntPtr pKeyboard; /** Keyboard device */
|
---|
111 |
|
---|
112 | int pitch; /**< Bell pitch */
|
---|
113 | unsigned long duration; /**< Bell duration */
|
---|
114 |
|
---|
115 | /* FIXME: dmxInput is never initialized */
|
---|
116 | DMXInputInfo *dmxInput; /**< For pretty-printing */
|
---|
117 | } myPrivate;
|
---|
118 | #endif
|
---|