1 | typedef enum |
---|
2 | { |
---|
3 | SDL_FIRSTEVENT = 0, |
---|
4 | SDL_QUIT = 0x100, |
---|
5 | SDL_APP_TERMINATING, |
---|
6 | SDL_APP_LOWMEMORY, |
---|
7 | SDL_APP_WILLENTERBACKGROUND, |
---|
8 | SDL_APP_DIDENTERBACKGROUND, |
---|
9 | SDL_APP_WILLENTERFOREGROUND, |
---|
10 | SDL_APP_DIDENTERFOREGROUND, |
---|
11 | SDL_WINDOWEVENT = 0x200, |
---|
12 | SDL_SYSWMEVENT, |
---|
13 | SDL_KEYDOWN = 0x300, |
---|
14 | SDL_KEYUP, |
---|
15 | SDL_TEXTEDITING, |
---|
16 | SDL_TEXTINPUT, |
---|
17 | SDL_MOUSEMOTION = 0x400, |
---|
18 | SDL_MOUSEBUTTONDOWN, |
---|
19 | SDL_MOUSEBUTTONUP, |
---|
20 | SDL_MOUSEWHEEL, |
---|
21 | SDL_JOYAXISMOTION = 0x600, |
---|
22 | SDL_JOYBALLMOTION, |
---|
23 | SDL_JOYHATMOTION, |
---|
24 | SDL_JOYBUTTONDOWN, |
---|
25 | SDL_JOYBUTTONUP, |
---|
26 | SDL_JOYDEVICEADDED, |
---|
27 | SDL_JOYDEVICEREMOVED, |
---|
28 | SDL_CONTROLLERAXISMOTION = 0x650, |
---|
29 | SDL_CONTROLLERBUTTONDOWN, |
---|
30 | SDL_CONTROLLERBUTTONUP, |
---|
31 | SDL_CONTROLLERDEVICEADDED, |
---|
32 | SDL_CONTROLLERDEVICEREMOVED, |
---|
33 | SDL_CONTROLLERDEVICEREMAPPED, |
---|
34 | SDL_FINGERDOWN = 0x700, |
---|
35 | SDL_FINGERUP, |
---|
36 | SDL_FINGERMOTION, |
---|
37 | SDL_DOLLARGESTURE = 0x800, |
---|
38 | SDL_DOLLARRECORD, |
---|
39 | SDL_MULTIGESTURE, |
---|
40 | SDL_CLIPBOARDUPDATE = 0x900, |
---|
41 | SDL_DROPFILE = 0x1000, |
---|
42 | SDL_USEREVENT = 0x8000, |
---|
43 | SDL_LASTEVENT = 0xFFFF |
---|
44 | } SDL_EventType; |
---|
45 | |
---|
46 | typedef struct SDL_CommonEvent |
---|
47 | { |
---|
48 | Uint32 type; |
---|
49 | Uint32 timestamp; |
---|
50 | } SDL_CommonEvent; |
---|
51 | |
---|
52 | typedef struct SDL_WindowEvent |
---|
53 | { |
---|
54 | Uint32 type; |
---|
55 | Uint32 timestamp; |
---|
56 | Uint32 windowID; |
---|
57 | Uint8 event; |
---|
58 | Uint8 padding1; |
---|
59 | Uint8 padding2; |
---|
60 | Uint8 padding3; |
---|
61 | Sint32 data1; |
---|
62 | Sint32 data2; |
---|
63 | } SDL_WindowEvent; |
---|
64 | |
---|
65 | typedef struct SDL_KeyboardEvent |
---|
66 | { |
---|
67 | Uint32 type; |
---|
68 | Uint32 timestamp; |
---|
69 | Uint32 windowID; |
---|
70 | Uint8 state; |
---|
71 | Uint8 repeat; |
---|
72 | Uint8 padding2; |
---|
73 | Uint8 padding3; |
---|
74 | SDL_Keysym keysym; |
---|
75 | } SDL_KeyboardEvent; |
---|
76 | |
---|
77 | #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) |
---|
78 | typedef struct SDL_TextEditingEvent |
---|
79 | { |
---|
80 | Uint32 type; |
---|
81 | Uint32 timestamp; |
---|
82 | Uint32 windowID; |
---|
83 | char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; |
---|
84 | Sint32 start; |
---|
85 | Sint32 length; |
---|
86 | } SDL_TextEditingEvent; |
---|
87 | |
---|
88 | |
---|
89 | #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) |
---|
90 | typedef struct SDL_TextInputEvent |
---|
91 | { |
---|
92 | Uint32 type; |
---|
93 | Uint32 timestamp; |
---|
94 | Uint32 windowID; |
---|
95 | char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; |
---|
96 | } SDL_TextInputEvent; |
---|
97 | |
---|
98 | typedef struct SDL_MouseMotionEvent |
---|
99 | { |
---|
100 | Uint32 type; |
---|
101 | Uint32 timestamp; |
---|
102 | Uint32 windowID; |
---|
103 | Uint32 which; |
---|
104 | Uint32 state; |
---|
105 | Sint32 x; |
---|
106 | Sint32 y; |
---|
107 | Sint32 xrel; |
---|
108 | Sint32 yrel; |
---|
109 | } SDL_MouseMotionEvent; |
---|
110 | |
---|
111 | typedef struct SDL_MouseButtonEvent |
---|
112 | { |
---|
113 | Uint32 type; |
---|
114 | Uint32 timestamp; |
---|
115 | Uint32 windowID; |
---|
116 | Uint32 which; |
---|
117 | Uint8 button; |
---|
118 | Uint8 state; |
---|
119 | Uint8 padding1; |
---|
120 | Uint8 padding2; |
---|
121 | Sint32 x; |
---|
122 | Sint32 y; |
---|
123 | } SDL_MouseButtonEvent; |
---|
124 | |
---|
125 | typedef struct SDL_MouseWheelEvent |
---|
126 | { |
---|
127 | Uint32 type; |
---|
128 | Uint32 timestamp; |
---|
129 | Uint32 windowID; |
---|
130 | Uint32 which; |
---|
131 | Sint32 x; |
---|
132 | Sint32 y; |
---|
133 | } SDL_MouseWheelEvent; |
---|
134 | |
---|
135 | typedef struct SDL_JoyAxisEvent |
---|
136 | { |
---|
137 | Uint32 type; |
---|
138 | Uint32 timestamp; |
---|
139 | SDL_JoystickID which; |
---|
140 | Uint8 axis; |
---|
141 | Uint8 padding1; |
---|
142 | Uint8 padding2; |
---|
143 | Uint8 padding3; |
---|
144 | Sint16 value; |
---|
145 | Uint16 padding4; |
---|
146 | } SDL_JoyAxisEvent; |
---|
147 | |
---|
148 | typedef struct SDL_JoyBallEvent |
---|
149 | { |
---|
150 | Uint32 type; |
---|
151 | Uint32 timestamp; |
---|
152 | SDL_JoystickID which; |
---|
153 | Uint8 ball; |
---|
154 | Uint8 padding1; |
---|
155 | Uint8 padding2; |
---|
156 | Uint8 padding3; |
---|
157 | Sint16 xrel; |
---|
158 | Sint16 yrel; |
---|
159 | } SDL_JoyBallEvent; |
---|
160 | |
---|
161 | typedef struct SDL_JoyHatEvent |
---|
162 | { |
---|
163 | Uint32 type; |
---|
164 | Uint32 timestamp; |
---|
165 | SDL_JoystickID which; |
---|
166 | Uint8 hat; |
---|
167 | Uint8 value; |
---|
168 | Uint8 padding1; |
---|
169 | Uint8 padding2; |
---|
170 | } SDL_JoyHatEvent; |
---|
171 | |
---|
172 | typedef struct SDL_JoyButtonEvent |
---|
173 | { |
---|
174 | Uint32 type; |
---|
175 | Uint32 timestamp; |
---|
176 | SDL_JoystickID which; |
---|
177 | Uint8 button; |
---|
178 | Uint8 state; |
---|
179 | Uint8 padding1; |
---|
180 | Uint8 padding2; |
---|
181 | } SDL_JoyButtonEvent; |
---|
182 | |
---|
183 | typedef struct SDL_JoyDeviceEvent |
---|
184 | { |
---|
185 | Uint32 type; |
---|
186 | Uint32 timestamp; |
---|
187 | Sint32 which; |
---|
188 | } SDL_JoyDeviceEvent; |
---|
189 | |
---|
190 | typedef struct SDL_ControllerAxisEvent |
---|
191 | { |
---|
192 | Uint32 type; |
---|
193 | Uint32 timestamp; |
---|
194 | SDL_JoystickID which; |
---|
195 | Uint8 axis; |
---|
196 | Uint8 padding1; |
---|
197 | Uint8 padding2; |
---|
198 | Uint8 padding3; |
---|
199 | Sint16 value; |
---|
200 | Uint16 padding4; |
---|
201 | } SDL_ControllerAxisEvent; |
---|
202 | |
---|
203 | typedef struct SDL_ControllerButtonEvent |
---|
204 | { |
---|
205 | Uint32 type; |
---|
206 | Uint32 timestamp; |
---|
207 | SDL_JoystickID which; |
---|
208 | Uint8 button; |
---|
209 | Uint8 state; |
---|
210 | Uint8 padding1; |
---|
211 | Uint8 padding2; |
---|
212 | } SDL_ControllerButtonEvent; |
---|
213 | |
---|
214 | typedef struct SDL_ControllerDeviceEvent |
---|
215 | { |
---|
216 | Uint32 type; |
---|
217 | Uint32 timestamp; |
---|
218 | Sint32 which; |
---|
219 | } SDL_ControllerDeviceEvent; |
---|
220 | |
---|
221 | typedef struct SDL_TouchFingerEvent |
---|
222 | { |
---|
223 | Uint32 type; |
---|
224 | Uint32 timestamp; |
---|
225 | SDL_TouchID touchId; |
---|
226 | SDL_FingerID fingerId; |
---|
227 | float x; |
---|
228 | float y; |
---|
229 | float dx; |
---|
230 | float dy; |
---|
231 | float pressure; |
---|
232 | } SDL_TouchFingerEvent; |
---|
233 | |
---|
234 | typedef struct SDL_MultiGestureEvent |
---|
235 | { |
---|
236 | Uint32 type; |
---|
237 | Uint32 timestamp; |
---|
238 | SDL_TouchID touchId; |
---|
239 | float dTheta; |
---|
240 | float dDist; |
---|
241 | float x; |
---|
242 | float y; |
---|
243 | Uint16 numFingers; |
---|
244 | Uint16 padding; |
---|
245 | } SDL_MultiGestureEvent; |
---|
246 | |
---|
247 | typedef struct SDL_DollarGestureEvent |
---|
248 | { |
---|
249 | Uint32 type; |
---|
250 | Uint32 timestamp; |
---|
251 | SDL_TouchID touchId; |
---|
252 | SDL_GestureID gestureId; |
---|
253 | Uint32 numFingers; |
---|
254 | float error; |
---|
255 | float x; |
---|
256 | float y; |
---|
257 | } SDL_DollarGestureEvent; |
---|
258 | |
---|
259 | typedef struct SDL_DropEvent |
---|
260 | { |
---|
261 | Uint32 type; |
---|
262 | Uint32 timestamp; |
---|
263 | char *file; |
---|
264 | } SDL_DropEvent; |
---|
265 | |
---|
266 | |
---|
267 | typedef struct SDL_QuitEvent |
---|
268 | { |
---|
269 | Uint32 type; |
---|
270 | Uint32 timestamp; |
---|
271 | } SDL_QuitEvent; |
---|
272 | |
---|
273 | typedef struct SDL_OSEvent |
---|
274 | { |
---|
275 | Uint32 type; |
---|
276 | Uint32 timestamp; |
---|
277 | } SDL_OSEvent; |
---|
278 | |
---|
279 | typedef struct SDL_UserEvent |
---|
280 | { |
---|
281 | Uint32 type; |
---|
282 | Uint32 timestamp; |
---|
283 | Uint32 windowID; |
---|
284 | Sint32 code; |
---|
285 | void *data1; |
---|
286 | void *data2; |
---|
287 | } SDL_UserEvent; |
---|
288 | |
---|
289 | |
---|
290 | struct SDL_SysWMmsg; |
---|
291 | typedef struct SDL_SysWMmsg SDL_SysWMmsg; |
---|
292 | |
---|
293 | typedef struct SDL_SysWMEvent |
---|
294 | { |
---|
295 | Uint32 type; |
---|
296 | Uint32 timestamp; |
---|
297 | SDL_SysWMmsg *msg; |
---|
298 | } SDL_SysWMEvent; |
---|
299 | |
---|
300 | typedef union SDL_Event |
---|
301 | { |
---|
302 | Uint32 type; |
---|
303 | SDL_CommonEvent common; |
---|
304 | SDL_WindowEvent window; |
---|
305 | SDL_KeyboardEvent key; |
---|
306 | SDL_TextEditingEvent edit; |
---|
307 | SDL_TextInputEvent text; |
---|
308 | SDL_MouseMotionEvent motion; |
---|
309 | SDL_MouseButtonEvent button; |
---|
310 | SDL_MouseWheelEvent wheel; |
---|
311 | SDL_JoyAxisEvent jaxis; |
---|
312 | SDL_JoyBallEvent jball; |
---|
313 | SDL_JoyHatEvent jhat; |
---|
314 | SDL_JoyButtonEvent jbutton; |
---|
315 | SDL_JoyDeviceEvent jdevice; |
---|
316 | SDL_ControllerAxisEvent caxis; |
---|
317 | SDL_ControllerButtonEvent cbutton; |
---|
318 | SDL_ControllerDeviceEvent cdevice; |
---|
319 | SDL_QuitEvent quit; |
---|
320 | SDL_UserEvent user; |
---|
321 | SDL_SysWMEvent syswm; |
---|
322 | SDL_TouchFingerEvent tfinger; |
---|
323 | SDL_MultiGestureEvent mgesture; |
---|
324 | SDL_DollarGestureEvent dgesture; |
---|
325 | SDL_DropEvent drop; |
---|
326 | Uint8 padding[56]; |
---|
327 | } SDL_Event; |
---|
328 | |
---|
329 | typedef enum |
---|
330 | { |
---|
331 | SDL_ADDEVENT, |
---|
332 | SDL_PEEKEVENT, |
---|
333 | SDL_GETEVENT |
---|
334 | } SDL_eventaction; |
---|
335 | |
---|