bindings: Use define-public instead of #:export.
[guile-sdl2.git] / sdl2 / bindings.scm
1 ;;; guile-sdl2 --- FFI bindings for SDL2
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
3 ;;;
4 ;;; This file is part of guile-sdl2.
5 ;;;
6 ;;; Guile-sdl2 is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation; either version 3 of the
9 ;;; License, or (at your option) any later version.
10 ;;;
11 ;;; Guile-sdl2 is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;;; General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with guile-sdl2. If not, see
18 ;;; <http://www.gnu.org/licenses/>.
19
20 ;;; Commentary:
21 ;;
22 ;; Low-level FFI bindings.
23 ;;
24 ;;; Code:
25
26 (define-module (sdl2 bindings)
27 #:use-module (system foreign)
28 #:use-module (sdl2 config))
29
30 (define sdl-func
31 (let ((lib (dynamic-link %libsdl2)))
32 (lambda (return-type function-name arg-types)
33 "Return a procedure for the foreign function FUNCTION-NAME in
34 the SDL2 shared library. That function must return a value of
35 RETURN-TYPE and accept arguments of ARG-TYPES."
36 (pointer->procedure return-type
37 (dynamic-func function-name lib)
38 arg-types))))
39
40 (define-syntax-rule (define-foreign name return-type func-name arg-types)
41 (define-public name
42 (sdl-func return-type func-name arg-types)))
43
44 \f
45 ;;;
46 ;;; Foreign Types
47 ;;;
48
49 (define-public sdl-color
50 (list uint8 uint8 uint8 uint8))
51
52 (define sdl-bool int)
53
54 (define-public (boolean->sdl-bool b)
55 "Convert the boolean B to an SDL_bool."
56 (if b 1 0))
57
58 \f
59 ;;;
60 ;;; Errors
61 ;;;
62
63 (define-foreign sdl-get-error
64 '* "SDL_GetError" '())
65
66 \f
67 ;;;
68 ;;; Initialization
69 ;;;
70
71 (define-public SDL_INIT_TIMER #x00000001)
72 (define-public SDL_INIT_AUDIO #x00000010)
73 (define-public SDL_INIT_VIDEO #x00000020)
74 (define-public SDL_INIT_HAPTIC #x00001000)
75 (define-public SDL_INIT_GAMECONTROLLER #x00002000)
76 (define-public SDL_INIT_EVENTS #x00004000)
77
78 (define-foreign sdl-init
79 int "SDL_Init" (list uint32))
80
81 (define-foreign sdl-quit
82 void "SDL_Quit" '())
83
84 \f
85 ;;;
86 ;;; Version
87 ;;;
88
89 (define-foreign sdl-get-version
90 void "SDL_GetVersion" '(*))
91
92 \f
93 ;;;
94 ;;; Video
95 ;;;
96
97 (define-public SDL_WINDOW_FULLSCREEN #x00000001)
98 (define-public SDL_WINDOW_OPENGL #x00000002)
99 (define-public SDL_WINDOW_SHOWN #x00000004)
100 (define-public SDL_WINDOW_HIDDEN #x00000008)
101 (define-public SDL_WINDOW_BORDERLESS #x00000010)
102 (define-public SDL_WINDOW_RESIZABLE #x00000020)
103 (define-public SDL_WINDOW_MINIMIZED #x00000040)
104 (define-public SDL_WINDOW_MAXIMIZED #x00000080)
105 (define-public SDL_WINDOW_INPUT_GRABBED #x00000100)
106 (define-public SDL_WINDOW_INPUT_FOCUS #x00000200)
107 (define-public SDL_WINDOW_MOUSE_FOCUS #x00000400)
108 (define-public SDL_WINDOW_FULLSCREEN_DESKTOP (logior SDL_WINDOW_FULLSCREEN
109 #x00001000))
110 (define-public SDL_WINDOW_FOREIGN #x00000800)
111 (define-public SDL_WINDOW_ALLOW_HIGHDPI #x00002000)
112 (define-public SDL_WINDOW_MOUSE_CAPTURE #x00004000)
113
114 (define-public SDL_WINDOWPOS_CENTERED 805240832)
115 (define-public SDL_WINDOWPOS_UNDEFINED 536805376)
116
117 (define-foreign sdl-create-window
118 '* "SDL_CreateWindow" (list '* int int int int uint32))
119
120 (define-foreign sdl-destroy-window
121 void "SDL_DestroyWindow" '(*))
122
123 (define-foreign sdl-get-window-title
124 '* "SDL_GetWindowTitle" '(*))
125
126 (define-foreign sdl-get-window-size
127 void "SDL_GetWindowSize" '(* * *))
128
129 (define-foreign sdl-get-window-position
130 void "SDL_GetWindowPosition" '(* * *))
131
132 (define-foreign sdl-get-window-id
133 uint32 "SDL_GetWindowID" '(*))
134
135 (define-foreign sdl-get-window-from-id
136 '* "SDL_GetWindowFromID" (list uint32))
137
138 (define-foreign sdl-hide-window
139 void "SDL_HideWindow" '(*))
140
141 (define-foreign sdl-show-window
142 void "SDL_ShowWindow" '(*))
143
144 (define-foreign sdl-maximize-window
145 void "SDL_MaximizeWindow" '(*))
146
147 (define-foreign sdl-minimize-window
148 void "SDL_MinimizeWindow" '(*))
149
150 (define-foreign sdl-raise-window
151 void "SDL_RaiseWindow" '(*))
152
153 (define-foreign sdl-restore-window
154 void "SDL_RestoreWindow" '(*))
155
156 (define-foreign sdl-set-window-bordered
157 void "SDL_SetWindowBordered" (list '* sdl-bool))
158
159 (define-foreign sdl-set-window-title
160 void "SDL_SetWindowTitle" '(* *))
161
162 (define-foreign sdl-set-window-position
163 void "SDL_SetWindowPosition" (list '* int int))
164
165 (define-foreign sdl-set-window-size
166 void "SDL_SetWindowSize" (list '* int int))
167
168 (define-foreign sdl-gl-create-context
169 '* "SDL_GL_CreateContext" '(*))
170
171 (define-foreign sdl-gl-delete-context
172 void "SDL_GL_DeleteContext" '(*))
173
174 (define-foreign sdl-gl-swap-window
175 void "SDL_GL_SwapWindow" '(*))
176
177 (define-public SDL_RENDERER_SOFTWARE #x00000001)
178 (define-public SDL_RENDERER_ACCELERATED #x00000002)
179 (define-public SDL_RENDERER_PRESENTVSYNC #x00000004)
180 (define-public SDL_RENDERER_TARGETTEXTURE #x00000008)
181
182 (define-foreign sdl-create-renderer
183 '* "SDL_CreateRenderer" (list '* int uint32))
184
185 (define-foreign sdl-destroy-renderer
186 void "SDL_DestroyRenderer" '(*))
187
188 (define-foreign sdl-render-clear
189 int "SDL_RenderClear" '(*))
190
191 (define-foreign sdl-render-present
192 void "SDL_RenderPresent" '(*))
193
194 (define-foreign sdl-render-copy
195 int "SDL_RenderCopy" '(* * * *))
196
197 (define-foreign sdl-create-texture-from-surface
198 '* "SDL_CreateTextureFromSurface" '(* *))
199
200 \f
201 ;;;
202 ;;; Events
203 ;;;
204
205 (define-public SDL_QUIT #x100)
206 (define-public SDL_APP_TERMINATING #x101)
207 (define-public SDL_APP_LOWMEMORY #x102)
208 (define-public SDL_APP_WILLENTERBACKGROUND #x103)
209 (define-public SDL_APP_DIDENTERBACKGROUND #x104)
210 (define-public SDL_APP_WILLENTERFOREGROUND #x105)
211 (define-public SDL_APP_DIDENTERFOREGROUND #x106)
212 (define-public SDL_WINDOWEVENT #x200)
213 (define-public SDL_SYSWMEVENT #x201)
214 (define-public SDL_KEYDOWN #x300)
215 (define-public SDL_KEYUP #x301)
216 (define-public SDL_TEXTEDITING #x302)
217 (define-public SDL_TEXTINPUT #x303)
218 (define-public SDL_MOUSEMOTION #x400)
219 (define-public SDL_MOUSEBUTTONDOWN #x401)
220 (define-public SDL_MOUSEBUTTONUP #x402)
221 (define-public SDL_MOUSEWHEEL #x403)
222 (define-public SDL_JOYAXISMOTION #x600)
223 (define-public SDL_JOYBALLMOTION #x601)
224 (define-public SDL_JOYHATMOTION #x602)
225 (define-public SDL_JOYBUTTONDOWN #x603)
226 (define-public SDL_JOYBUTTONUP #x604)
227 (define-public SDL_JOYDEVICEADDED #x605)
228 (define-public SDL_JOYDEVICEREMOVED #x606)
229 (define-public SDL_CONTROLLERAXISMOTION #x650)
230 (define-public SDL_CONTROLLERBUTTONDOWN #x651)
231 (define-public SDL_CONTROLLERBUTTONUP #x652)
232 (define-public SDL_CONTROLLERDEVICEADDED #x653)
233 (define-public SDL_CONTROLLERDEVICEREMOVED #x654)
234 (define-public SDL_CONTROLLERDEVICEREMAPPED #x655)
235 (define-public SDL_FINGERDOWN #x700)
236 (define-public SDL_FINGERUP #x701)
237 (define-public SDL_FINGERMOTION #x702)
238 (define-public SDL_DOLLARGESTURE #x800)
239 (define-public SDL_DOLLARRECORD #x801)
240 (define-public SDL_MULTIGESTURE #x802)
241 (define-public SDL_CLIPBOARDUPDATE #x900)
242 (define-public SDL_DROPFILE #x1000)
243 (define-public SDL_RENDER_TARGETS_RESET #x2000)
244 (define-public SDL_USEREVENT #x8000)
245
246 (define-public SDL_RELEASED 0)
247 (define-public SDL_PRESSED 1)
248
249 (define-public SDL_WINDOWEVENT_NONE 0)
250 (define-public SDL_WINDOWEVENT_SHOWN 1)
251 (define-public SDL_WINDOWEVENT_HIDDEN 2)
252 (define-public SDL_WINDOWEVENT_EXPOSED 3)
253 (define-public SDL_WINDOWEVENT_MOVED 4)
254 (define-public SDL_WINDOWEVENT_RESIZED 5)
255 (define-public SDL_WINDOWEVENT_SIZE_CHANGED 6)
256 (define-public SDL_WINDOWEVENT_MINIMIZED 7)
257 (define-public SDL_WINDOWEVENT_MAXIMIZED 8)
258 (define-public SDL_WINDOWEVENT_RESTORED 9)
259 (define-public SDL_WINDOWEVENT_ENTER 10)
260 (define-public SDL_WINDOWEVENT_LEAVE 11)
261 (define-public SDL_WINDOWEVENT_FOCUS_GAINED 12)
262 (define-public SDL_WINDOWEVENT_FOCUS_LOST 13)
263 (define-public SDL_WINDOWEVENT_CLOSE 14)
264
265 (define-foreign sdl-poll-event
266 int "SDL_PollEvent" '(*))
267
268 \f
269 ;;;
270 ;;; Keycodes and scancodes
271 ;;;
272
273 (define-public KMOD_NONE #x0000)
274 (define-public KMOD_LSHIFT #x0001)
275 (define-public KMOD_RSHIFT #x0002)
276 (define-public KMOD_LCTRL #x0040)
277 (define-public KMOD_RCTRL #x0080)
278 (define-public KMOD_LALT #x0100)
279 (define-public KMOD_RALT #x0200)
280 (define-public KMOD_LGUI #x0400)
281 (define-public KMOD_RGUI #x0800)
282 (define-public KMOD_NUM #x1000)
283 (define-public KMOD_CAPS #x2000)
284 (define-public KMOD_MODE #x4000)
285
286 (define-public SDLK_SCANCODE_MASK (ash 1 30))
287
288 (define-public (scancode->keycode scancode)
289 (logior scancode SDLK_SCANCODE_MASK))
290
291 (define-public SDL_SCANCODE_UNKNOWN 0)
292 (define-public SDL_SCANCODE_A 4)
293 (define-public SDL_SCANCODE_B 5)
294 (define-public SDL_SCANCODE_C 6)
295 (define-public SDL_SCANCODE_D 7)
296 (define-public SDL_SCANCODE_E 8)
297 (define-public SDL_SCANCODE_F 9)
298 (define-public SDL_SCANCODE_G 10)
299 (define-public SDL_SCANCODE_H 11)
300 (define-public SDL_SCANCODE_I 12)
301 (define-public SDL_SCANCODE_J 13)
302 (define-public SDL_SCANCODE_K 14)
303 (define-public SDL_SCANCODE_L 15)
304 (define-public SDL_SCANCODE_M 16)
305 (define-public SDL_SCANCODE_N 17)
306 (define-public SDL_SCANCODE_O 18)
307 (define-public SDL_SCANCODE_P 19)
308 (define-public SDL_SCANCODE_Q 20)
309 (define-public SDL_SCANCODE_R 21)
310 (define-public SDL_SCANCODE_S 22)
311 (define-public SDL_SCANCODE_T 23)
312 (define-public SDL_SCANCODE_U 24)
313 (define-public SDL_SCANCODE_V 25)
314 (define-public SDL_SCANCODE_W 26)
315 (define-public SDL_SCANCODE_X 27)
316 (define-public SDL_SCANCODE_Y 28)
317 (define-public SDL_SCANCODE_Z 29)
318 (define-public SDL_SCANCODE_1 30)
319 (define-public SDL_SCANCODE_2 31)
320 (define-public SDL_SCANCODE_3 32)
321 (define-public SDL_SCANCODE_4 33)
322 (define-public SDL_SCANCODE_5 34)
323 (define-public SDL_SCANCODE_6 35)
324 (define-public SDL_SCANCODE_7 36)
325 (define-public SDL_SCANCODE_8 37)
326 (define-public SDL_SCANCODE_9 38)
327 (define-public SDL_SCANCODE_0 39)
328 (define-public SDL_SCANCODE_RETURN 40)
329 (define-public SDL_SCANCODE_ESCAPE 41)
330 (define-public SDL_SCANCODE_BACKSPACE 42)
331 (define-public SDL_SCANCODE_TAB 43)
332 (define-public SDL_SCANCODE_SPACE 44)
333 (define-public SDL_SCANCODE_MINUS 45)
334 (define-public SDL_SCANCODE_EQUALS 46)
335 (define-public SDL_SCANCODE_LEFTBRACKET 47)
336 (define-public SDL_SCANCODE_RIGHTBRACKET 48)
337 (define-public SDL_SCANCODE_BACKSLASH 49)
338 (define-public SDL_SCANCODE_NONUSHASH 50)
339 (define-public SDL_SCANCODE_SEMICOLON 51)
340 (define-public SDL_SCANCODE_APOSTROPHE 52)
341 (define-public SDL_SCANCODE_GRAVE 53)
342 (define-public SDL_SCANCODE_COMMA 54)
343 (define-public SDL_SCANCODE_PERIOD 55)
344 (define-public SDL_SCANCODE_SLASH 56)
345 (define-public SDL_SCANCODE_CAPSLOCK 57)
346 (define-public SDL_SCANCODE_F1 58)
347 (define-public SDL_SCANCODE_F2 59)
348 (define-public SDL_SCANCODE_F3 60)
349 (define-public SDL_SCANCODE_F4 61)
350 (define-public SDL_SCANCODE_F5 62)
351 (define-public SDL_SCANCODE_F6 63)
352 (define-public SDL_SCANCODE_F7 64)
353 (define-public SDL_SCANCODE_F8 65)
354 (define-public SDL_SCANCODE_F9 66)
355 (define-public SDL_SCANCODE_F10 67)
356 (define-public SDL_SCANCODE_F11 68)
357 (define-public SDL_SCANCODE_F12 69)
358 (define-public SDL_SCANCODE_PRINTSCREEN 70)
359 (define-public SDL_SCANCODE_SCROLLLOCK 71)
360 (define-public SDL_SCANCODE_PAUSE 72)
361 (define-public SDL_SCANCODE_INSERT 73)
362 (define-public SDL_SCANCODE_HOME 74)
363 (define-public SDL_SCANCODE_PAGEUP 75)
364 (define-public SDL_SCANCODE_DELETE 76)
365 (define-public SDL_SCANCODE_END 77)
366 (define-public SDL_SCANCODE_PAGEDOWN 78)
367 (define-public SDL_SCANCODE_RIGHT 79)
368 (define-public SDL_SCANCODE_LEFT 80)
369 (define-public SDL_SCANCODE_DOWN 81)
370 (define-public SDL_SCANCODE_UP 82)
371 (define-public SDL_SCANCODE_NUMLOCKCLEAR 83)
372 (define-public SDL_SCANCODE_KP_DIVIDE 84)
373 (define-public SDL_SCANCODE_KP_MULTIPLY 85)
374 (define-public SDL_SCANCODE_KP_MINUS 86)
375 (define-public SDL_SCANCODE_KP_PLUS 87)
376 (define-public SDL_SCANCODE_KP_ENTER 88)
377 (define-public SDL_SCANCODE_KP_1 89)
378 (define-public SDL_SCANCODE_KP_2 90)
379 (define-public SDL_SCANCODE_KP_3 91)
380 (define-public SDL_SCANCODE_KP_4 92)
381 (define-public SDL_SCANCODE_KP_5 93)
382 (define-public SDL_SCANCODE_KP_6 94)
383 (define-public SDL_SCANCODE_KP_7 95)
384 (define-public SDL_SCANCODE_KP_8 96)
385 (define-public SDL_SCANCODE_KP_9 97)
386 (define-public SDL_SCANCODE_KP_0 98)
387 (define-public SDL_SCANCODE_KP_PERIOD 99)
388 (define-public SDL_SCANCODE_NONUSBACKSLASH 100)
389 (define-public SDL_SCANCODE_APPLICATION 101)
390 (define-public SDL_SCANCODE_POWER 102)
391 (define-public SDL_SCANCODE_KP_EQUALS 103)
392 (define-public SDL_SCANCODE_F13 104)
393 (define-public SDL_SCANCODE_F14 105)
394 (define-public SDL_SCANCODE_F15 106)
395 (define-public SDL_SCANCODE_F16 107)
396 (define-public SDL_SCANCODE_F17 108)
397 (define-public SDL_SCANCODE_F18 109)
398 (define-public SDL_SCANCODE_F19 110)
399 (define-public SDL_SCANCODE_F20 111)
400 (define-public SDL_SCANCODE_F21 112)
401 (define-public SDL_SCANCODE_F22 113)
402 (define-public SDL_SCANCODE_F23 114)
403 (define-public SDL_SCANCODE_F24 115)
404 (define-public SDL_SCANCODE_EXECUTE 116)
405 (define-public SDL_SCANCODE_HELP 117)
406 (define-public SDL_SCANCODE_MENU 118)
407 (define-public SDL_SCANCODE_SELECT 119)
408 (define-public SDL_SCANCODE_STOP 120)
409 (define-public SDL_SCANCODE_AGAIN 121)
410 (define-public SDL_SCANCODE_UNDO 122)
411 (define-public SDL_SCANCODE_CUT 123)
412 (define-public SDL_SCANCODE_COPY 124)
413 (define-public SDL_SCANCODE_PASTE 125)
414 (define-public SDL_SCANCODE_FIND 126)
415 (define-public SDL_SCANCODE_MUTE 127)
416 (define-public SDL_SCANCODE_VOLUMEUP 128)
417 (define-public SDL_SCANCODE_VOLUMEDOWN 129)
418 (define-public SDL_SCANCODE_KP_COMMA 133)
419 (define-public SDL_SCANCODE_KP_EQUALSAS400 134)
420 (define-public SDL_SCANCODE_INTERNATIONAL1 135)
421 (define-public SDL_SCANCODE_INTERNATIONAL2 136)
422 (define-public SDL_SCANCODE_INTERNATIONAL3 137)
423 (define-public SDL_SCANCODE_INTERNATIONAL4 138)
424 (define-public SDL_SCANCODE_INTERNATIONAL5 139)
425 (define-public SDL_SCANCODE_INTERNATIONAL6 140)
426 (define-public SDL_SCANCODE_INTERNATIONAL7 141)
427 (define-public SDL_SCANCODE_INTERNATIONAL8 142)
428 (define-public SDL_SCANCODE_INTERNATIONAL9 143)
429 (define-public SDL_SCANCODE_LANG1 144)
430 (define-public SDL_SCANCODE_LANG2 145)
431 (define-public SDL_SCANCODE_LANG3 146)
432 (define-public SDL_SCANCODE_LANG4 147)
433 (define-public SDL_SCANCODE_LANG5 148)
434 (define-public SDL_SCANCODE_LANG6 149)
435 (define-public SDL_SCANCODE_LANG7 150)
436 (define-public SDL_SCANCODE_LANG8 151)
437 (define-public SDL_SCANCODE_LANG9 152)
438 (define-public SDL_SCANCODE_ALTERASE 153)
439 (define-public SDL_SCANCODE_SYSREQ 154)
440 (define-public SDL_SCANCODE_CANCEL 155)
441 (define-public SDL_SCANCODE_CLEAR 156)
442 (define-public SDL_SCANCODE_PRIOR 157)
443 (define-public SDL_SCANCODE_RETURN2 158)
444 (define-public SDL_SCANCODE_SEPARATOR 159)
445 (define-public SDL_SCANCODE_OUT 160)
446 (define-public SDL_SCANCODE_OPER 161)
447 (define-public SDL_SCANCODE_CLEARAGAIN 162)
448 (define-public SDL_SCANCODE_CRSEL 163)
449 (define-public SDL_SCANCODE_EXSEL 164)
450 (define-public SDL_SCANCODE_KP_00 176)
451 (define-public SDL_SCANCODE_KP_000 177)
452 (define-public SDL_SCANCODE_THOUSANDSSEPARATOR 178)
453 (define-public SDL_SCANCODE_DECIMALSEPARATOR 179)
454 (define-public SDL_SCANCODE_CURRENCYUNIT 180)
455 (define-public SDL_SCANCODE_CURRENCYSUBUNIT 181)
456 (define-public SDL_SCANCODE_KP_LEFTPAREN 182)
457 (define-public SDL_SCANCODE_KP_RIGHTPAREN 183)
458 (define-public SDL_SCANCODE_KP_LEFTBRACE 184)
459 (define-public SDL_SCANCODE_KP_RIGHTBRACE 185)
460 (define-public SDL_SCANCODE_KP_TAB 186)
461 (define-public SDL_SCANCODE_KP_BACKSPACE 187)
462 (define-public SDL_SCANCODE_KP_A 188)
463 (define-public SDL_SCANCODE_KP_B 189)
464 (define-public SDL_SCANCODE_KP_C 190)
465 (define-public SDL_SCANCODE_KP_D 191)
466 (define-public SDL_SCANCODE_KP_E 192)
467 (define-public SDL_SCANCODE_KP_F 193)
468 (define-public SDL_SCANCODE_KP_XOR 194)
469 (define-public SDL_SCANCODE_KP_POWER 195)
470 (define-public SDL_SCANCODE_KP_PERCENT 196)
471 (define-public SDL_SCANCODE_KP_LESS 197)
472 (define-public SDL_SCANCODE_KP_GREATER 198)
473 (define-public SDL_SCANCODE_KP_AMPERSAND 199)
474 (define-public SDL_SCANCODE_KP_DBLAMPERSAND 200)
475 (define-public SDL_SCANCODE_KP_VERTICALBAR 201)
476 (define-public SDL_SCANCODE_KP_DBLVERTICALBAR 202)
477 (define-public SDL_SCANCODE_KP_COLON 203)
478 (define-public SDL_SCANCODE_KP_HASH 204)
479 (define-public SDL_SCANCODE_KP_SPACE 205)
480 (define-public SDL_SCANCODE_KP_AT 206)
481 (define-public SDL_SCANCODE_KP_EXCLAM 207)
482 (define-public SDL_SCANCODE_KP_MEMSTORE 208)
483 (define-public SDL_SCANCODE_KP_MEMRECALL 209)
484 (define-public SDL_SCANCODE_KP_MEMCLEAR 210)
485 (define-public SDL_SCANCODE_KP_MEMADD 211)
486 (define-public SDL_SCANCODE_KP_MEMSUBTRACT 212)
487 (define-public SDL_SCANCODE_KP_MEMMULTIPLY 213)
488 (define-public SDL_SCANCODE_KP_MEMDIVIDE 214)
489 (define-public SDL_SCANCODE_KP_PLUSMINUS 215)
490 (define-public SDL_SCANCODE_KP_CLEAR 216)
491 (define-public SDL_SCANCODE_KP_CLEARENTRY 217)
492 (define-public SDL_SCANCODE_KP_BINARY 218)
493 (define-public SDL_SCANCODE_KP_OCTAL 219)
494 (define-public SDL_SCANCODE_KP_DECIMAL 220)
495 (define-public SDL_SCANCODE_KP_HEXADECIMAL 221)
496 (define-public SDL_SCANCODE_LCTRL 224)
497 (define-public SDL_SCANCODE_LSHIFT 225)
498 (define-public SDL_SCANCODE_LALT 226)
499 (define-public SDL_SCANCODE_LGUI 227)
500 (define-public SDL_SCANCODE_RCTRL 228)
501 (define-public SDL_SCANCODE_RSHIFT 229)
502 (define-public SDL_SCANCODE_RALT 230)
503 (define-public SDL_SCANCODE_RGUI 231)
504 (define-public SDL_SCANCODE_MODE 257)
505 (define-public SDL_SCANCODE_AUDIONEXT 258)
506 (define-public SDL_SCANCODE_AUDIOPREV 259)
507 (define-public SDL_SCANCODE_AUDIOSTOP 260)
508 (define-public SDL_SCANCODE_AUDIOPLAY 261)
509 (define-public SDL_SCANCODE_AUDIOMUTE 262)
510 (define-public SDL_SCANCODE_MEDIASELECT 263)
511 (define-public SDL_SCANCODE_WWW 264)
512 (define-public SDL_SCANCODE_MAIL 265)
513 (define-public SDL_SCANCODE_CALCULATOR 266)
514 (define-public SDL_SCANCODE_COMPUTER 267)
515 (define-public SDL_SCANCODE_AC_SEARCH 268)
516 (define-public SDL_SCANCODE_AC_HOME 269)
517 (define-public SDL_SCANCODE_AC_BACK 270)
518 (define-public SDL_SCANCODE_AC_FORWARD 271)
519 (define-public SDL_SCANCODE_AC_STOP 272)
520 (define-public SDL_SCANCODE_AC_REFRESH 273)
521 (define-public SDL_SCANCODE_AC_BOOKMARKS 274)
522 (define-public SDL_SCANCODE_BRIGHTNESSDOWN 275)
523 (define-public SDL_SCANCODE_BRIGHTNESSUP 276)
524 (define-public SDL_SCANCODE_DISPLAYSWITCH 277)
525 (define-public SDL_SCANCODE_KBDILLUMTOGGLE 278)
526 (define-public SDL_SCANCODE_KBDILLUMDOWN 279)
527 (define-public SDL_SCANCODE_KBDILLUMUP 280)
528 (define-public SDL_SCANCODE_EJECT 281)
529 (define-public SDL_SCANCODE_SLEEP 282)
530 (define-public SDL_SCANCODE_APP1 283)
531 (define-public SDL_SCANCODE_APP2 284)
532 (define-public SDL_NUM_SCANCODES 512)
533
534 (define-public SDLK_UNKNOWN 0)
535 (define-public SDLK_RETURN 13)
536 (define-public SDLK_ESCAPE 27)
537 (define-public SDLK_BACKSPACE 8)
538 (define-public SDLK_TAB 9)
539 (define-public SDLK_SPACE 32)
540 (define-public SDLK_EXCLAIM 33)
541 (define-public SDLK_QUOTEDBL 34)
542 (define-public SDLK_HASH 35)
543 (define-public SDLK_PERCENT 37)
544 (define-public SDLK_DOLLAR 36)
545 (define-public SDLK_AMPERSAND 38)
546 (define-public SDLK_QUOTE 39)
547 (define-public SDLK_LEFTPAREN 40)
548 (define-public SDLK_RIGHTPAREN 41)
549 (define-public SDLK_ASTERISK 42)
550 (define-public SDLK_PLUS 43)
551 (define-public SDLK_COMMA 44)
552 (define-public SDLK_MINUS 45)
553 (define-public SDLK_PERIOD 46)
554 (define-public SDLK_SLASH 47)
555 (define-public SDLK_0 48)
556 (define-public SDLK_1 49)
557 (define-public SDLK_2 50)
558 (define-public SDLK_3 51)
559 (define-public SDLK_4 52)
560 (define-public SDLK_5 53)
561 (define-public SDLK_6 54)
562 (define-public SDLK_7 55)
563 (define-public SDLK_8 56)
564 (define-public SDLK_9 57)
565 (define-public SDLK_COLON 58)
566 (define-public SDLK_SEMICOLON 59)
567 (define-public SDLK_LESS 60)
568 (define-public SDLK_EQUALS 61)
569 (define-public SDLK_GREATER 62)
570 (define-public SDLK_QUESTION 63)
571 (define-public SDLK_AT 64)
572 (define-public SDLK_LEFTBRACKET 91)
573 (define-public SDLK_BACKSLASH 92)
574 (define-public SDLK_RIGHTBRACKET 93)
575 (define-public SDLK_CARET 94)
576 (define-public SDLK_UNDERSCORE 95)
577 (define-public SDLK_BACKQUOTE 96)
578 (define-public SDLK_a 97)
579 (define-public SDLK_b 98)
580 (define-public SDLK_c 99)
581 (define-public SDLK_d 100)
582 (define-public SDLK_e 101)
583 (define-public SDLK_f 102)
584 (define-public SDLK_g 103)
585 (define-public SDLK_h 104)
586 (define-public SDLK_i 105)
587 (define-public SDLK_j 106)
588 (define-public SDLK_k 107)
589 (define-public SDLK_l 108)
590 (define-public SDLK_m 109)
591 (define-public SDLK_n 110)
592 (define-public SDLK_o 111)
593 (define-public SDLK_p 112)
594 (define-public SDLK_q 113)
595 (define-public SDLK_r 114)
596 (define-public SDLK_s 115)
597 (define-public SDLK_t 116)
598 (define-public SDLK_u 117)
599 (define-public SDLK_v 118)
600 (define-public SDLK_w 119)
601 (define-public SDLK_x 120)
602 (define-public SDLK_y 121)
603 (define-public SDLK_z 122)
604 (define-public SDLK_CAPSLOCK (scancode->keycode SDL_SCANCODE_CAPSLOCK))
605 (define-public SDLK_F1 (scancode->keycode SDL_SCANCODE_F1))
606 (define-public SDLK_F2 (scancode->keycode SDL_SCANCODE_F2))
607 (define-public SDLK_F3 (scancode->keycode SDL_SCANCODE_F3))
608 (define-public SDLK_F4 (scancode->keycode SDL_SCANCODE_F4))
609 (define-public SDLK_F5 (scancode->keycode SDL_SCANCODE_F5))
610 (define-public SDLK_F6 (scancode->keycode SDL_SCANCODE_F6))
611 (define-public SDLK_F7 (scancode->keycode SDL_SCANCODE_F7))
612 (define-public SDLK_F8 (scancode->keycode SDL_SCANCODE_F8))
613 (define-public SDLK_F9 (scancode->keycode SDL_SCANCODE_F9))
614 (define-public SDLK_F10 (scancode->keycode SDL_SCANCODE_F10))
615 (define-public SDLK_F11 (scancode->keycode SDL_SCANCODE_F11))
616 (define-public SDLK_F12 (scancode->keycode SDL_SCANCODE_F12))
617 (define-public SDLK_PRINTSCREEN (scancode->keycode SDL_SCANCODE_PRINTSCREEN))
618 (define-public SDLK_SCROLLLOCK (scancode->keycode SDL_SCANCODE_SCROLLLOCK))
619 (define-public SDLK_PAUSE (scancode->keycode SDL_SCANCODE_PAUSE))
620 (define-public SDLK_INSERT (scancode->keycode SDL_SCANCODE_INSERT))
621 (define-public SDLK_HOME (scancode->keycode SDL_SCANCODE_HOME))
622 (define-public SDLK_PAGEUP (scancode->keycode SDL_SCANCODE_PAGEUP))
623 (define-public SDLK_DELETE 127)
624 (define-public SDLK_END (scancode->keycode SDL_SCANCODE_END))
625 (define-public SDLK_PAGEDOWN (scancode->keycode SDL_SCANCODE_PAGEDOWN))
626 (define-public SDLK_RIGHT (scancode->keycode SDL_SCANCODE_RIGHT))
627 (define-public SDLK_LEFT (scancode->keycode SDL_SCANCODE_LEFT))
628 (define-public SDLK_DOWN (scancode->keycode SDL_SCANCODE_DOWN))
629 (define-public SDLK_UP (scancode->keycode SDL_SCANCODE_UP))
630 (define-public SDLK_NUMLOCKCLEAR (scancode->keycode SDL_SCANCODE_NUMLOCKCLEAR))
631 (define-public SDLK_KP_DIVIDE (scancode->keycode SDL_SCANCODE_KP_DIVIDE))
632 (define-public SDLK_KP_MULTIPLY (scancode->keycode SDL_SCANCODE_KP_MULTIPLY))
633 (define-public SDLK_KP_MINUS (scancode->keycode SDL_SCANCODE_KP_MINUS))
634 (define-public SDLK_KP_PLUS (scancode->keycode SDL_SCANCODE_KP_PLUS))
635 (define-public SDLK_KP_ENTER (scancode->keycode SDL_SCANCODE_KP_ENTER))
636 (define-public SDLK_KP_1 (scancode->keycode SDL_SCANCODE_KP_1))
637 (define-public SDLK_KP_2 (scancode->keycode SDL_SCANCODE_KP_2))
638 (define-public SDLK_KP_3 (scancode->keycode SDL_SCANCODE_KP_3))
639 (define-public SDLK_KP_4 (scancode->keycode SDL_SCANCODE_KP_4))
640 (define-public SDLK_KP_5 (scancode->keycode SDL_SCANCODE_KP_5))
641 (define-public SDLK_KP_6 (scancode->keycode SDL_SCANCODE_KP_6))
642 (define-public SDLK_KP_7 (scancode->keycode SDL_SCANCODE_KP_7))
643 (define-public SDLK_KP_8 (scancode->keycode SDL_SCANCODE_KP_8))
644 (define-public SDLK_KP_9 (scancode->keycode SDL_SCANCODE_KP_9))
645 (define-public SDLK_KP_0 (scancode->keycode SDL_SCANCODE_KP_0))
646 (define-public SDLK_KP_PERIOD (scancode->keycode SDL_SCANCODE_KP_PERIOD))
647 (define-public SDLK_APPLICATION (scancode->keycode SDL_SCANCODE_APPLICATION))
648 (define-public SDLK_POWER (scancode->keycode SDL_SCANCODE_POWER))
649 (define-public SDLK_KP_EQUALS (scancode->keycode SDL_SCANCODE_KP_EQUALS))
650 (define-public SDLK_F13 (scancode->keycode SDL_SCANCODE_F13))
651 (define-public SDLK_F14 (scancode->keycode SDL_SCANCODE_F14))
652 (define-public SDLK_F15 (scancode->keycode SDL_SCANCODE_F15))
653 (define-public SDLK_F16 (scancode->keycode SDL_SCANCODE_F16))
654 (define-public SDLK_F17 (scancode->keycode SDL_SCANCODE_F17))
655 (define-public SDLK_F18 (scancode->keycode SDL_SCANCODE_F18))
656 (define-public SDLK_F19 (scancode->keycode SDL_SCANCODE_F19))
657 (define-public SDLK_F20 (scancode->keycode SDL_SCANCODE_F20))
658 (define-public SDLK_F21 (scancode->keycode SDL_SCANCODE_F21))
659 (define-public SDLK_F22 (scancode->keycode SDL_SCANCODE_F22))
660 (define-public SDLK_F23 (scancode->keycode SDL_SCANCODE_F23))
661 (define-public SDLK_F24 (scancode->keycode SDL_SCANCODE_F24))
662 (define-public SDLK_EXECUTE (scancode->keycode SDL_SCANCODE_EXECUTE))
663 (define-public SDLK_HELP (scancode->keycode SDL_SCANCODE_HELP))
664 (define-public SDLK_MENU (scancode->keycode SDL_SCANCODE_MENU))
665 (define-public SDLK_SELECT (scancode->keycode SDL_SCANCODE_SELECT))
666 (define-public SDLK_STOP (scancode->keycode SDL_SCANCODE_STOP))
667 (define-public SDLK_AGAIN (scancode->keycode SDL_SCANCODE_AGAIN))
668 (define-public SDLK_UNDO (scancode->keycode SDL_SCANCODE_UNDO))
669 (define-public SDLK_CUT (scancode->keycode SDL_SCANCODE_CUT))
670 (define-public SDLK_COPY (scancode->keycode SDL_SCANCODE_COPY))
671 (define-public SDLK_PASTE (scancode->keycode SDL_SCANCODE_PASTE))
672 (define-public SDLK_FIND (scancode->keycode SDL_SCANCODE_FIND))
673 (define-public SDLK_MUTE (scancode->keycode SDL_SCANCODE_MUTE))
674 (define-public SDLK_VOLUMEUP (scancode->keycode SDL_SCANCODE_VOLUMEUP))
675 (define-public SDLK_VOLUMEDOWN (scancode->keycode SDL_SCANCODE_VOLUMEDOWN))
676 (define-public SDLK_KP_COMMA (scancode->keycode SDL_SCANCODE_KP_COMMA))
677 (define-public SDLK_KP_EQUALSAS400
678 (scancode->keycode SDL_SCANCODE_KP_EQUALSAS400))
679 (define-public SDLK_ALTERASE (scancode->keycode SDL_SCANCODE_ALTERASE))
680 (define-public SDLK_SYSREQ (scancode->keycode SDL_SCANCODE_SYSREQ))
681 (define-public SDLK_CANCEL (scancode->keycode SDL_SCANCODE_CANCEL))
682 (define-public SDLK_CLEAR (scancode->keycode SDL_SCANCODE_CLEAR))
683 (define-public SDLK_PRIOR (scancode->keycode SDL_SCANCODE_PRIOR))
684 (define-public SDLK_RETURN2 (scancode->keycode SDL_SCANCODE_RETURN2))
685 (define-public SDLK_SEPARATOR (scancode->keycode SDL_SCANCODE_SEPARATOR))
686 (define-public SDLK_OUT (scancode->keycode SDL_SCANCODE_OUT))
687 (define-public SDLK_OPER (scancode->keycode SDL_SCANCODE_OPER))
688 (define-public SDLK_CLEARAGAIN (scancode->keycode SDL_SCANCODE_CLEARAGAIN))
689 (define-public SDLK_CRSEL (scancode->keycode SDL_SCANCODE_CRSEL))
690 (define-public SDLK_EXSEL (scancode->keycode SDL_SCANCODE_EXSEL))
691 (define-public SDLK_KP_00 (scancode->keycode SDL_SCANCODE_KP_00))
692 (define-public SDLK_KP_000 (scancode->keycode SDL_SCANCODE_KP_000))
693 (define-public SDLK_THOUSANDSSEPARATOR
694 (scancode->keycode SDL_SCANCODE_THOUSANDSSEPARATOR))
695 (define-public SDLK_DECIMALSEPARATOR
696 (scancode->keycode SDL_SCANCODE_DECIMALSEPARATOR))
697 (define-public SDLK_CURRENCYUNIT (scancode->keycode SDL_SCANCODE_CURRENCYUNIT))
698 (define-public SDLK_CURRENCYSUBUNIT
699 (scancode->keycode SDL_SCANCODE_CURRENCYSUBUNIT))
700 (define-public SDLK_KP_LEFTPAREN (scancode->keycode SDL_SCANCODE_KP_LEFTPAREN))
701 (define-public SDLK_KP_RIGHTPAREN
702 (scancode->keycode SDL_SCANCODE_KP_RIGHTPAREN))
703 (define-public SDLK_KP_LEFTBRACE (scancode->keycode SDL_SCANCODE_KP_LEFTBRACE))
704 (define-public SDLK_KP_RIGHTBRACE (scancode->keycode SDL_SCANCODE_KP_RIGHTBRACE))
705 (define-public SDLK_KP_TAB (scancode->keycode SDL_SCANCODE_KP_TAB))
706 (define-public SDLK_KP_BACKSPACE (scancode->keycode SDL_SCANCODE_KP_BACKSPACE))
707 (define-public SDLK_KP_A (scancode->keycode SDL_SCANCODE_KP_A))
708 (define-public SDLK_KP_B (scancode->keycode SDL_SCANCODE_KP_B))
709 (define-public SDLK_KP_C (scancode->keycode SDL_SCANCODE_KP_C))
710 (define-public SDLK_KP_D (scancode->keycode SDL_SCANCODE_KP_D))
711 (define-public SDLK_KP_E (scancode->keycode SDL_SCANCODE_KP_E))
712 (define-public SDLK_KP_F (scancode->keycode SDL_SCANCODE_KP_F))
713 (define-public SDLK_KP_XOR (scancode->keycode SDL_SCANCODE_KP_XOR))
714 (define-public SDLK_KP_POWER (scancode->keycode SDL_SCANCODE_KP_POWER))
715 (define-public SDLK_KP_PERCENT (scancode->keycode SDL_SCANCODE_KP_PERCENT))
716 (define-public SDLK_KP_LESS (scancode->keycode SDL_SCANCODE_KP_LESS))
717 (define-public SDLK_KP_GREATER (scancode->keycode SDL_SCANCODE_KP_GREATER))
718 (define-public SDLK_KP_AMPERSAND (scancode->keycode SDL_SCANCODE_KP_AMPERSAND))
719 (define-public SDLK_KP_DBLAMPERSAND
720 (scancode->keycode SDL_SCANCODE_KP_DBLAMPERSAND))
721 (define-public SDLK_KP_VERTICALBAR
722 (scancode->keycode SDL_SCANCODE_KP_VERTICALBAR))
723 (define-public SDLK_KP_DBLVERTICALBAR
724 (scancode->keycode SDL_SCANCODE_KP_DBLVERTICALBAR))
725 (define-public SDLK_KP_COLON (scancode->keycode SDL_SCANCODE_KP_COLON))
726 (define-public SDLK_KP_HASH (scancode->keycode SDL_SCANCODE_KP_HASH))
727 (define-public SDLK_KP_SPACE (scancode->keycode SDL_SCANCODE_KP_SPACE))
728 (define-public SDLK_KP_AT (scancode->keycode SDL_SCANCODE_KP_AT))
729 (define-public SDLK_KP_EXCLAM (scancode->keycode SDL_SCANCODE_KP_EXCLAM))
730 (define-public SDLK_KP_MEMSTORE (scancode->keycode SDL_SCANCODE_KP_MEMSTORE))
731 (define-public SDLK_KP_MEMRECALL (scancode->keycode SDL_SCANCODE_KP_MEMRECALL))
732 (define-public SDLK_KP_MEMCLEAR (scancode->keycode SDL_SCANCODE_KP_MEMCLEAR))
733 (define-public SDLK_KP_MEMADD (scancode->keycode SDL_SCANCODE_KP_MEMADD))
734 (define-public SDLK_KP_MEMSUBTRACT
735 (scancode->keycode SDL_SCANCODE_KP_MEMSUBTRACT))
736 (define-public SDLK_KP_MEMMULTIPLY
737 (scancode->keycode SDL_SCANCODE_KP_MEMMULTIPLY))
738 (define-public SDLK_KP_MEMDIVIDE (scancode->keycode SDL_SCANCODE_KP_MEMDIVIDE))
739 (define-public SDLK_KP_PLUSMINUS (scancode->keycode SDL_SCANCODE_KP_PLUSMINUS))
740 (define-public SDLK_KP_CLEAR (scancode->keycode SDL_SCANCODE_KP_CLEAR))
741 (define-public SDLK_KP_CLEARENTRY (scancode->keycode SDL_SCANCODE_KP_CLEARENTRY))
742 (define-public SDLK_KP_BINARY (scancode->keycode SDL_SCANCODE_KP_BINARY))
743 (define-public SDLK_KP_OCTAL (scancode->keycode SDL_SCANCODE_KP_OCTAL))
744 (define-public SDLK_KP_DECIMAL (scancode->keycode SDL_SCANCODE_KP_DECIMAL))
745 (define-public SDLK_KP_HEXADECIMAL
746 (scancode->keycode SDL_SCANCODE_KP_HEXADECIMAL))
747 (define-public SDLK_LCTRL (scancode->keycode SDL_SCANCODE_LCTRL))
748 (define-public SDLK_LSHIFT (scancode->keycode SDL_SCANCODE_LSHIFT))
749 (define-public SDLK_LALT (scancode->keycode SDL_SCANCODE_LALT))
750 (define-public SDLK_LGUI (scancode->keycode SDL_SCANCODE_LGUI))
751 (define-public SDLK_RCTRL (scancode->keycode SDL_SCANCODE_RCTRL))
752 (define-public SDLK_RSHIFT (scancode->keycode SDL_SCANCODE_RSHIFT))
753 (define-public SDLK_RALT (scancode->keycode SDL_SCANCODE_RALT))
754 (define-public SDLK_RGUI (scancode->keycode SDL_SCANCODE_RGUI))
755 (define-public SDLK_MODE (scancode->keycode SDL_SCANCODE_MODE))
756 (define-public SDLK_AUDIONEXT (scancode->keycode SDL_SCANCODE_AUDIONEXT))
757 (define-public SDLK_AUDIOPREV (scancode->keycode SDL_SCANCODE_AUDIOPREV))
758 (define-public SDLK_AUDIOSTOP (scancode->keycode SDL_SCANCODE_AUDIOSTOP))
759 (define-public SDLK_AUDIOPLAY (scancode->keycode SDL_SCANCODE_AUDIOPLAY))
760 (define-public SDLK_AUDIOMUTE (scancode->keycode SDL_SCANCODE_AUDIOMUTE))
761 (define-public SDLK_MEDIASELECT (scancode->keycode SDL_SCANCODE_MEDIASELECT))
762 (define-public SDLK_WWW (scancode->keycode SDL_SCANCODE_WWW))
763 (define-public SDLK_MAIL (scancode->keycode SDL_SCANCODE_MAIL))
764 (define-public SDLK_CALCULATOR (scancode->keycode SDL_SCANCODE_CALCULATOR))
765 (define-public SDLK_COMPUTER (scancode->keycode SDL_SCANCODE_COMPUTER))
766 (define-public SDLK_AC_SEARCH (scancode->keycode SDL_SCANCODE_AC_SEARCH))
767 (define-public SDLK_AC_HOME (scancode->keycode SDL_SCANCODE_AC_HOME))
768 (define-public SDLK_AC_BACK (scancode->keycode SDL_SCANCODE_AC_BACK))
769 (define-public SDLK_AC_FORWARD (scancode->keycode SDL_SCANCODE_AC_FORWARD))
770 (define-public SDLK_AC_STOP (scancode->keycode SDL_SCANCODE_AC_STOP))
771 (define-public SDLK_AC_REFRESH (scancode->keycode SDL_SCANCODE_AC_REFRESH))
772 (define-public SDLK_AC_BOOKMARKS (scancode->keycode SDL_SCANCODE_AC_BOOKMARKS))
773 (define-public SDLK_BRIGHTNESSDOWN
774 (scancode->keycode SDL_SCANCODE_BRIGHTNESSDOWN))
775 (define-public SDLK_BRIGHTNESSUP (scancode->keycode SDL_SCANCODE_BRIGHTNESSUP))
776 (define-public SDLK_DISPLAYSWITCH (scancode->keycode SDL_SCANCODE_DISPLAYSWITCH))
777 (define-public SDLK_KBDILLUMTOGGLE
778 (scancode->keycode SDL_SCANCODE_KBDILLUMTOGGLE))
779 (define-public SDLK_KBDILLUMDOWN (scancode->keycode SDL_SCANCODE_KBDILLUMDOWN))
780 (define-public SDLK_KBDILLUMUP (scancode->keycode SDL_SCANCODE_KBDILLUMUP))
781 (define-public SDLK_EJECT (scancode->keycode SDL_SCANCODE_EJECT))
782 (define-public SDLK_SLEEP (scancode->keycode SDL_SCANCODE_SLEEP))
783
784 \f
785 ;;;
786 ;;; Mouse
787 ;;;
788
789 (define-public SDL_BUTTON_LEFT 1)
790 (define-public SDL_BUTTON_MIDDLE 2)
791 (define-public SDL_BUTTON_RIGHT 3)
792 (define-public SDL_BUTTON_X1 4)
793 (define-public SDL_BUTTON_X2 5)
794
795 (define (button-mask n)
796 (ash 1 (1- n)))
797
798 (define-public SDL_BUTTON_LMASK (button-mask SDL_BUTTON_LEFT))
799 (define-public SDL_BUTTON_MMASK (button-mask SDL_BUTTON_MIDDLE))
800 (define-public SDL_BUTTON_RMASK (button-mask SDL_BUTTON_RIGHT))
801 (define-public SDL_BUTTON_X1MASK (button-mask SDL_BUTTON_X1))
802 (define-public SDL_BUTTON_X2MASK (button-mask SDL_BUTTON_X2))
803
804
805 \f
806 ;;;
807 ;;; Timer
808 ;;;
809
810 (define-foreign sdl-get-ticks
811 uint32 "SDL_GetTicks" '())
812
813 \f
814 ;;;
815 ;;; File I/O
816 ;;;
817
818 (define-foreign sdl-rw-from-file
819 '* "SDL_RWFromFile" (list '* '*))
820
821 \f
822 ;;;
823 ;;; Pixels
824 ;;;
825
826 (define-public SDL_PIXELFORMAT_UNKNOWN 0)
827 (define-public SDL_PIXELFORMAT_INDEX1LSB 286261504)
828 (define-public SDL_PIXELFORMAT_INDEX1MSB 287310080)
829 (define-public SDL_PIXELFORMAT_INDEX4LSB 303039488)
830 (define-public SDL_PIXELFORMAT_INDEX4MSB 304088064)
831 (define-public SDL_PIXELFORMAT_INDEX8 318769153)
832 (define-public SDL_PIXELFORMAT_RGB332 336660481)
833 (define-public SDL_PIXELFORMAT_RGB444 353504258)
834 (define-public SDL_PIXELFORMAT_RGB555 353570562)
835 (define-public SDL_PIXELFORMAT_BGR555 357764866)
836 (define-public SDL_PIXELFORMAT_ARGB4444 355602434)
837 (define-public SDL_PIXELFORMAT_RGBA4444 356651010)
838 (define-public SDL_PIXELFORMAT_ABGR4444 359796738)
839 (define-public SDL_PIXELFORMAT_BGRA4444 360845314)
840 (define-public SDL_PIXELFORMAT_ARGB1555 355667970)
841 (define-public SDL_PIXELFORMAT_RGBA5551 356782082)
842 (define-public SDL_PIXELFORMAT_ABGR1555 359862274)
843 (define-public SDL_PIXELFORMAT_BGRA5551 360976386)
844 (define-public SDL_PIXELFORMAT_RGB565 353701890)
845 (define-public SDL_PIXELFORMAT_BGR565 357896194)
846 (define-public SDL_PIXELFORMAT_RGB24 386930691)
847 (define-public SDL_PIXELFORMAT_BGR24 390076419)
848 (define-public SDL_PIXELFORMAT_RGB888 370546692)
849 (define-public SDL_PIXELFORMAT_RGBX8888 371595268)
850 (define-public SDL_PIXELFORMAT_BGR888 374740996)
851 (define-public SDL_PIXELFORMAT_BGRX8888 375789572)
852 (define-public SDL_PIXELFORMAT_ARGB8888 372645892)
853 (define-public SDL_PIXELFORMAT_RGBA8888 373694468)
854 (define-public SDL_PIXELFORMAT_ABGR8888 376840196)
855 (define-public SDL_PIXELFORMAT_BGRA8888 377888772)
856 (define-public SDL_PIXELFORMAT_ARGB2101010 372711428)
857 (define-public SDL_PIXELFORMAT_YV12 842094169)
858 (define-public SDL_PIXELFORMAT_IYUV 1448433993)
859 (define-public SDL_PIXELFORMAT_YUY2 844715353)
860 (define-public SDL_PIXELFORMAT_UYVY 1498831189)
861 (define-public SDL_PIXELFORMAT_YVYU 1431918169)
862
863 \f
864 ;;;
865 ;;; Surface
866 ;;;
867
868 (define-foreign sdl-free-surface
869 void "SDL_FreeSurface" '(*))
870
871 (define-foreign sdl-load-bmp-rw
872 '* "SDL_LoadBMP_RW" (list '* int))
873
874 (define-foreign sdl-convert-surface-format
875 '* "SDL_ConvertSurfaceFormat" (list '* uint32 uint32))
876
877 \f
878 ;;;
879 ;;; Audio
880 ;;;
881
882 (define-public AUDIO_U8 #x0008)
883 (define-public AUDIO_S8 #x8008)
884 (define-public AUDIO_U16LSB #x0010)
885 (define-public AUDIO_S16LSB #x8010)
886 (define-public AUDIO_U16MSB #x1010)
887 (define-public AUDIO_S16MSB #x9010)
888 (define-public AUDIO_U16 AUDIO_U16LSB)
889 (define-public AUDIO_S16 AUDIO_S16LSB)
890 (define-public AUDIO_S32LSB #x8020)
891 (define-public AUDIO_S32MSB #x9020)
892 (define-public AUDIO_S32 AUDIO_S32LSB)
893 (define-public AUDIO_F32LSB #x8120)
894 (define-public AUDIO_F32MSB #x9120)
895 (define-public AUDIO_F32 AUDIO_F32LSB)