Initial commit
[xorg_rtime.git] / xorg-server-1.4 / hw / xgl / egl / xegl.h
blobbe9b48c9cedd60f32ce38ec1d12b16eae617ad35
1 /*
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
13 * implied warranty.
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>
26 #ifndef _XEGL_H_
27 #define _XEGL_H_
29 #include "xgl.h"
31 #include "randrstr.h"
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 {
41 Bool (*Init) (void);
42 void (*Fini) (void);
43 } KdMouseFuncs;
45 typedef struct _KdKeyboardFuncs {
46 void (*Load) (void);
47 int (*Init) (void);
48 void (*Leds) (int);
49 void (*Bell) (int, int, int);
50 void (*Fini) (void);
51 int LockLed;
52 } KdKeyboardFuncs;
54 typedef struct _KdOsFuncs {
55 int (*Init) (void);
56 void (*Enable) (void);
57 Bool (*SpecialKey) (KeySym);
58 void (*Disable) (void);
59 void (*Fini) (void);
60 void (*pollEvents) (void);
61 } KdOsFuncs;
63 typedef struct _KdMouseMatrix {
64 int matrix[2][3];
65 } KdMouseMatrix;
67 typedef enum _KdMouseState {
68 start,
69 button_1_pend,
70 button_1_down,
71 button_2_down,
72 button_3_pend,
73 button_3_down,
74 synth_2_down_13,
75 synth_2_down_3,
76 synth_2_down_1,
77 num_input_states
78 } KdMouseState;
80 #define KD_MAX_BUTTON 7
82 typedef struct _KdMouseInfo {
83 struct _KdMouseInfo *next;
84 void *driver;
85 void *closure;
86 char *name;
87 char *prot;
88 char map[KD_MAX_BUTTON];
89 int nbutton;
90 Bool emulateMiddleButton;
91 unsigned long emulationTimeout;
92 Bool timeoutPending;
93 KdMouseState mouseState;
94 Bool eventHeld;
95 xEvent heldEvent;
96 unsigned char buttonState;
97 int emulationDx, emulationDy;
98 int inputType;
99 Bool transformCoordinates;
100 } KdMouseInfo;
102 typedef struct _xeglScreen {
103 CloseScreenProcPtr CloseScreen;
104 ScreenPtr pScreen;
105 DDXPointRec origin;
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)
125 void
126 eglInitInput (KdMouseFuncs *pMouseFuncs,
127 KdKeyboardFuncs *pKeyboardFuncs);
129 void
130 KdParseMouse (char *arg);
132 KdMouseInfo *
133 KdMouseInfoAdd (void);
135 void
136 KdMouseInfoDispose (KdMouseInfo *mi);
139 KdAllocInputType (void);
141 char *
142 KdSaveString (char *str);
144 Bool
145 KdRegisterFd (int type,
146 int fd,
147 void (*read) (int fd, void *closure),
148 void *closure);
150 void
151 KdUnregisterFds (int type,
152 Bool do_close);
154 void
155 KdEnqueueKeyboardEvent (unsigned char scan_code,
156 unsigned char is_up);
158 void
159 KdEnqueueMouseEvent (KdMouseInfo *mi,
160 unsigned long flags,
161 int rx,
162 int ry);
164 void
165 KdRegisterFdEnableDisable (int fd,
166 int (*enable) (int fd, void *closure),
167 void (*disable) (int fd, void *closure));
169 void
170 KdWakeupHandler (pointer data,
171 int result,
172 pointer readmask);
174 Bool
175 KdLegalModifier (unsigned int key,
176 DeviceIntPtr pDev);
178 void
179 KdProcessInputEvents (void);
181 void
182 xeglInitOutput (ScreenInfo *pScreenInfo,
183 int argc,
184 char **argv);
186 Bool
187 xeglLegalModifier (unsigned int key,
188 DevicePtr pDev);
190 void
191 xeglProcessInputEvents (void);
193 void
194 xeglInitInput (int argc,
195 char **argv);
197 void
198 xeglUseMsg (void);
201 xeglProcessArgument (int argc,
202 char **argv,
203 int i);
205 void
206 xeglAbort (void);
208 void
209 xeglGiveUp (void);
211 void
212 xeglOsVendorInit (void);
214 #endif /* _XEGL_H_ */