2 * Copyright © 2005 Novell, Inc.
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Novell, Inc. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Novell, Inc. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
15 * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: David Reveman <davidr@novell.com>
33 #define KD_BUTTON_1 0x01
34 #define KD_BUTTON_2 0x02
35 #define KD_BUTTON_3 0x04
36 #define KD_BUTTON_4 0x08
37 #define KD_BUTTON_5 0x10
38 #define KD_MOUSE_DELTA 0x80000000
40 typedef struct _KdMouseFuncs
{
45 typedef struct _KdKeyboardFuncs
{
49 void (*Bell
) (int, int, int);
54 typedef struct _KdOsFuncs
{
56 void (*Enable
) (void);
57 Bool (*SpecialKey
) (KeySym
);
58 void (*Disable
) (void);
60 void (*pollEvents
) (void);
63 typedef struct _KdMouseMatrix
{
67 typedef enum _KdMouseState
{
80 #define KD_MAX_BUTTON 7
82 typedef struct _KdMouseInfo
{
83 struct _KdMouseInfo
*next
;
88 char map
[KD_MAX_BUTTON
];
90 Bool emulateMiddleButton
;
91 unsigned long emulationTimeout
;
93 KdMouseState mouseState
;
96 unsigned char buttonState
;
97 int emulationDx
, emulationDy
;
99 Bool transformCoordinates
;
102 typedef struct _xeglScreen
{
103 CloseScreenProcPtr CloseScreen
;
106 } xeglScreenRec
, *xeglScreenPtr
;
108 extern KdMouseInfo
*kdMouseInfo
;
109 extern KdOsFuncs
*kdOsFuncs
;
110 extern Bool kdDontZap
;
111 extern Bool kdDisableZaphod
;
112 extern int xeglScreenPrivateIndex
;
113 extern KdMouseFuncs LinuxEvdevMouseFuncs
;
114 extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs
;
116 #define RR_Rotate_All \
117 (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)
118 #define RR_Reflect_All (RR_Reflect_X | RR_Reflect_Y)
120 #define KdGetScreenPriv(pScreen) \
121 ((xeglScreenPtr) ((pScreen)->devPrivates[xeglScreenPrivateIndex].ptr))
122 #define KdScreenPriv(pScreen) \
123 xeglScreenPtr pScreenPriv = KdGetScreenPriv (pScreen)
126 eglInitInput (KdMouseFuncs
*pMouseFuncs
,
127 KdKeyboardFuncs
*pKeyboardFuncs
);
130 KdParseMouse (char *arg
);
133 KdMouseInfoAdd (void);
136 KdMouseInfoDispose (KdMouseInfo
*mi
);
139 KdAllocInputType (void);
142 KdSaveString (char *str
);
145 KdRegisterFd (int type
,
147 void (*read
) (int fd
, void *closure
),
151 KdUnregisterFds (int type
,
155 KdEnqueueKeyboardEvent (unsigned char scan_code
,
156 unsigned char is_up
);
159 KdEnqueueMouseEvent (KdMouseInfo
*mi
,
165 KdRegisterFdEnableDisable (int fd
,
166 int (*enable
) (int fd
, void *closure
),
167 void (*disable
) (int fd
, void *closure
));
170 KdWakeupHandler (pointer data
,
175 KdLegalModifier (unsigned int key
,
179 KdProcessInputEvents (void);
182 xeglInitOutput (ScreenInfo
*pScreenInfo
,
187 xeglLegalModifier (unsigned int key
,
191 xeglProcessInputEvents (void);
194 xeglInitInput (int argc
,
201 xeglProcessArgument (int argc
,
212 xeglOsVendorInit (void);
214 #endif /* _XEGL_H_ */