3
'''Constants and enums for all SDL submodules.
6
__docformat__ = 'restructuredtext'
13
# The keyboard syms have been cleverly chosen to map to ASCII
55
# Skip uppercase letters
59
SDLK_RIGHTBRACKET = 93
90
# End of ASCII mapped keysyms
92
# International keyboard syms
93
SDLK_WORLD_0 = 160 # 0xA0
188
SDLK_WORLD_95 = 255 # 0xFF
203
SDLK_KP_MULTIPLY = 268
209
# Arrows + Home/End pad
237
# Key state modifier keys
249
SDLK_LSUPER = 311 # Left "Windows" key
250
SDLK_RSUPER = 312 # Right "Windows" key
251
SDLK_MODE = 313 # "Alt Gr" key
252
SDLK_COMPOSE = 314 # Multi-key compose key
254
# Miscellaneous function keys
260
SDLK_POWER = 320 # Power Macintosh power key
261
SDLK_EURO = 321 # Some european keyboards
262
SDLK_UNDO = 322 # Atari keyboard has Undo
264
SDLK_LAST = 323 # Keep me updated please.
282
KMOD_RESERVED = 0x8000
286
KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL
287
KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT
288
KMOD_ALT = KMOD_LALT | KMOD_RALT
289
KMOD_META = KMOD_LMETA | KMOD_RMETA
291
#BEGIN GENERATED CONSTANTS; see support/make_constants.py
293
#Constants from SDL_mouse.h:
294
SDL_BUTTON_LEFT = 0x00000001
295
SDL_BUTTON_MIDDLE = 0x00000002
296
SDL_BUTTON_RIGHT = 0x00000003
297
SDL_BUTTON_WHEELUP = 0x00000004
298
SDL_BUTTON_WHEELDOWN = 0x00000005
300
#Constants from SDL_version.h:
301
SDL_MAJOR_VERSION = 0x00000001
302
SDL_MINOR_VERSION = 0x00000002
303
SDL_PATCHLEVEL = 0x0000000a
305
#Constants from SDL.h:
306
SDL_INIT_TIMER = 0x00000001
307
SDL_INIT_AUDIO = 0x00000010
308
SDL_INIT_VIDEO = 0x00000020
309
SDL_INIT_CDROM = 0x00000100
310
SDL_INIT_JOYSTICK = 0x00000200
311
SDL_INIT_NOPARACHUTE = 0x00100000
312
SDL_INIT_EVENTTHREAD = 0x01000000
313
SDL_INIT_EVERYTHING = 0x0000ffff
315
#Constants from SDL_mutex.h:
316
SDL_MUTEX_TIMEDOUT = 0x00000001
318
#Constants from SDL_video.h:
319
SDL_ALPHA_OPAQUE = 0x000000ff
320
SDL_ALPHA_TRANSPARENT = 0x00000000
321
SDL_SWSURFACE = 0x00000000
322
SDL_HWSURFACE = 0x00000001
323
SDL_ASYNCBLIT = 0x00000004
324
SDL_ANYFORMAT = 0x10000000
325
SDL_HWPALETTE = 0x20000000
326
SDL_DOUBLEBUF = 0x40000000
327
SDL_FULLSCREEN = 0x80000000
328
SDL_OPENGL = 0x00000002
329
SDL_OPENGLBLIT = 0x0000000a
330
SDL_RESIZABLE = 0x00000010
331
SDL_NOFRAME = 0x00000020
332
SDL_HWACCEL = 0x00000100
333
SDL_SRCCOLORKEY = 0x00001000
334
SDL_RLEACCELOK = 0x00002000
335
SDL_RLEACCEL = 0x00004000
336
SDL_SRCALPHA = 0x00010000
337
SDL_PREALLOC = 0x01000000
338
SDL_YV12_OVERLAY = 0x32315659
339
SDL_IYUV_OVERLAY = 0x56555949
340
SDL_YUY2_OVERLAY = 0x32595559
341
SDL_UYVY_OVERLAY = 0x59565955
342
SDL_YVYU_OVERLAY = 0x55595659
343
SDL_LOGPAL = 0x00000001
344
SDL_PHYSPAL = 0x00000002
346
#Constants from SDL_name.h:
347
NeedFunctionPrototypes = 0x00000001
349
#Constants from SDL_endian.h:
350
SDL_LIL_ENDIAN = 0x000004d2
351
SDL_BIG_ENDIAN = 0x000010e1
353
#Constants from SDL_audio.h:
354
AUDIO_U8 = 0x00000008
355
AUDIO_S8 = 0x00008008
356
AUDIO_U16LSB = 0x00000010
357
AUDIO_S16LSB = 0x00008010
358
AUDIO_U16MSB = 0x00001010
359
AUDIO_S16MSB = 0x00009010
360
SDL_MIX_MAXVOLUME = 0x00000080
362
#Constants from begin_code.h:
365
#Constants from SDL_cdrom.h:
366
SDL_MAX_TRACKS = 0x00000063
367
SDL_AUDIO_TRACK = 0x00000000
368
SDL_DATA_TRACK = 0x00000004
371
#Constants from SDL_events.h:
372
SDL_RELEASED = 0x00000000
373
SDL_PRESSED = 0x00000001
374
SDL_ALLEVENTS = 0xffffffff
375
SDL_IGNORE = 0x00000000
376
SDL_DISABLE = 0x00000000
377
SDL_ENABLE = 0x00000001
379
#Constants from SDL_active.h:
380
SDL_APPMOUSEFOCUS = 0x00000001
381
SDL_APPINPUTFOCUS = 0x00000002
382
SDL_APPACTIVE = 0x00000004
384
#Constants from SDL_joystick.h:
385
SDL_HAT_CENTERED = 0x00000000
386
SDL_HAT_UP = 0x00000001
387
SDL_HAT_RIGHT = 0x00000002
388
SDL_HAT_DOWN = 0x00000004
389
SDL_HAT_LEFT = 0x00000008
391
#Constants from SDL_keyboard.h:
392
SDL_ALL_HOTKEYS = 0xffffffff
393
SDL_DEFAULT_REPEAT_DELAY = 0x000001f4
394
SDL_DEFAULT_REPEAT_INTERVAL = 0x0000001e
396
#Constants from SDL_rwops.h:
397
RW_SEEK_SET = 0x00000000
398
RW_SEEK_CUR = 0x00000001
399
RW_SEEK_END = 0x00000002
401
#Constants from SDL_timer.h:
402
SDL_TIMESLICE = 0x0000000a
403
TIMER_RESOLUTION = 0x0000000a
404
#END GENERATED CONSTANTS
406
# From SDL_audio.h (inserted manually)
408
# enum SDL_audiostatus
411
SDL_AUDIO_PAUSED) = range(3)
413
if sys.byteorder == 'little':
414
AUDIO_U16SYS = AUDIO_U16LSB
415
AUDIO_S16SYS = AUDIO_S16LSB
417
AUDIO_U16SYS = AUDIO_U16MSB
418
AUDIO_S16SYS = AUDIO_S16MSB
419
AUDIO_U16 = AUDIO_U16LSB
420
AUDIO_S16 = AUDIO_S16LSB
422
# From SDL_cdrom.h (inserted manually)
427
CD_PAUSED) = range(4)
430
# From SDL_events.h (inserted manually)
455
SDL_EVENT_RESERVED7) = range(24)
459
def SDL_EVENTMASK(x):
460
'''Used for predefining event masks.'''
464
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT)
465
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN)
466
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP)
467
SDL_KEYEVENTMASK = SDL_KEYUPMASK | \
469
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)
470
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)
471
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP)
472
SDL_MOUSEEVENTMASK = SDL_MOUSEMOTIONMASK | \
473
SDL_MOUSEBUTTONDOWNMASK | \
474
SDL_MOUSEBUTTONUPMASK
475
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)
476
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION)
477
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION)
478
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN)
479
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP)
480
SDL_JOYEVENTMASK = SDL_JOYAXISMOTIONMASK | \
481
SDL_JOYBALLMOTIONMASK | \
482
SDL_JOYHATMOTIONMASK | \
483
SDL_JOYBUTTONDOWNMASK | \
485
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT)
486
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
487
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE)
488
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE)
490
# enum SDL_eventaction
493
SDL_GETEVENT) = range(3)
495
#From SDL_joystick.h (inserted manually)
496
SDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP
497
SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN
498
SDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP
499
SDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN
501
# From SDL_video.h (inserted manually)
511
SDL_GL_ACCUM_RED_SIZE,
512
SDL_GL_ACCUM_GREEN_SIZE,
513
SDL_GL_ACCUM_BLUE_SIZE,
514
SDL_GL_ACCUM_ALPHA_SIZE,
516
SDL_GL_MULTISAMPLEBUFFERS,
517
SDL_GL_MULTISAMPLESAMPLES,
518
SDL_GL_ACCELERATED_VISUAL,
519
SDL_GL_SWAP_CONTROL) = range(17)
524
SDL_GRAB_ON) = range(-1,2)
526
# From SDL_ttf.h (inserted manually)
527
TTF_STYLE_NORMAL = 0x00
528
TTF_STYLE_BOLD = 0x01
529
TTF_STYLE_ITALIC = 0x02
530
TTF_STYLE_UNDERLINE = 0x04
532
# From SDL_mixer.h (inserted manually)
534
MIX_DEFAULT_FREQUENCY = 22050
536
MIX_CHANNEL_POST = -2
537
MIX_EFFECTSMAXSPEED = 'MIX_EFFECTSMAXSPEED'
538
MIX_DEFAULT_CHANNELS = 2
540
if sys.byteorder == 'little':
541
MIX_DEFAULT_FORMAT = AUDIO_S16LSB
543
MIX_DEFAULT_FORMAT = AUDIO_S16MSB
548
MIX_FADING_IN) = range(3)
559
# From SDL_sound.h (inserted manually):
560
# enum Sound_SampleFlags
561
SOUND_SAMPLEFLAG_NONE = 0
562
SOUND_SAMPLEFLAG_CANSEEK = 1
563
SOUND_SAMPLEFLAG_EOF = 1 << 29
564
SOUND_SAMPLEFLAG_ERROR = 1 << 30
565
SOUND_SAMPLEFLAG_EGAIN = 1 << 31