Source

pygame / SDL / constants.py

Diff from to

SDL/constants.py

 TIMER_RESOLUTION = 0x0000000a
 #END GENERATED CONSTANTS
 
+# From SDL_audio.h (inserted manually)
+
+# enum SDL_audiostatus
+(SDL_AUDIO_STOPPED,
+    SDL_AUDIO_PLAYING,
+    SDL_AUDIO_PAUSED) = range(3)
+
+if sys.byteorder == 'little':
+    AUDIO_U16SYS = AUDIO_U16LSB
+    AUDIO_S16SYS = AUDIO_S16LSB
+else:
+    AUDIO_U16SYS = AUDIO_U16MSB
+    AUDIO_S16SYS = AUDIO_S16MSB
+AUDIO_U16 = AUDIO_U16LSB
+AUDIO_S16 = AUDIO_S16LSB
+
+# From SDL_cdrom.h (inserted manually)
+# enum CDstatus
+(CD_TRAYEMPTY,
+    CD_STOPPED,
+    CD_PLAYING,
+    CD_PAUSED) = range(4)
+CD_ERROR = -1
+
+# From SDL_events.h (inserted manually)
+# enum SDL_EventType
+(SDL_NOEVENT,
+    SDL_ACTIVEEVENT,
+    SDL_KEYDOWN,
+    SDL_KEYUP,
+    SDL_MOUSEMOTION,
+    SDL_MOUSEBUTTONDOWN,
+    SDL_MOUSEBUTTONUP,
+    SDL_JOYAXISMOTION,
+    SDL_JOYBALLMOTION,
+    SDL_JOYHATMOTION,
+    SDL_JOYBUTTONDOWN,
+    SDL_JOYBUTTONUP,
+    SDL_QUIT,
+    SDL_SYSWMEVENT,
+    SDL_EVENT_RESERVEDA,
+    SDL_EVENT_RESERVEDB,
+    SDL_VIDEORESIZE,
+    SDL_VIDEOEXPOSE,
+    SDL_EVENT_RESERVED2,
+    SDL_EVENT_RESERVED3,
+    SDL_EVENT_RESERVED4,
+    SDL_EVENT_RESERVED5,
+    SDL_EVENT_RESERVED6,
+    SDL_EVENT_RESERVED7) = range(24)
+SDL_USEREVENT = 24
+SDL_NUMEVENTS = 32
+
+def SDL_EVENTMASK(x):
+    '''Used for predefining event masks.'''
+    return 1 << x
+
+# enum SDL_EventMask
+SDL_ACTIVEEVENTMASK     = SDL_EVENTMASK(SDL_ACTIVEEVENT)
+SDL_KEYDOWNMASK         = SDL_EVENTMASK(SDL_KEYDOWN)
+SDL_KEYUPMASK           = SDL_EVENTMASK(SDL_KEYUP)
+SDL_KEYEVENTMASK        = SDL_KEYUPMASK | \
+                          SDL_KEYDOWNMASK
+SDL_MOUSEMOTIONMASK     = SDL_EVENTMASK(SDL_MOUSEMOTION)
+SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)
+SDL_MOUSEBUTTONUPMASK   = SDL_EVENTMASK(SDL_MOUSEBUTTONUP)
+SDL_MOUSEEVENTMASK      = SDL_MOUSEMOTIONMASK | \
+                          SDL_MOUSEBUTTONDOWNMASK | \
+                          SDL_MOUSEBUTTONUPMASK
+SDL_JOYAXISMOTIONMASK   = SDL_EVENTMASK(SDL_JOYAXISMOTION)
+SDL_JOYBALLMOTIONMASK   = SDL_EVENTMASK(SDL_JOYBALLMOTION)
+SDL_JOYHATMOTIONMASK    = SDL_EVENTMASK(SDL_JOYHATMOTION)
+SDL_JOYBUTTONDOWNMASK   = SDL_EVENTMASK(SDL_JOYBUTTONDOWN)
+SDL_JOYBUTTONUPMASK     = SDL_EVENTMASK(SDL_JOYBUTTONUP)
+SDL_JOYEVENTMASK        = SDL_JOYAXISMOTIONMASK | \
+                          SDL_JOYBALLMOTIONMASK | \
+                          SDL_JOYHATMOTIONMASK | \
+                          SDL_JOYBUTTONDOWNMASK | \
+                          SDL_JOYBUTTONUPMASK
+SDL_QUITMASK            = SDL_EVENTMASK(SDL_QUIT)
+SDL_SYSWMEVENTMASK      = SDL_EVENTMASK(SDL_SYSWMEVENT)
+SDL_VIDEORESIZEMASK     = SDL_EVENTMASK(SDL_VIDEORESIZE)
+SDL_VIDEOEXPOSEMASK     = SDL_EVENTMASK(SDL_VIDEOEXPOSE)
+
+# enum SDL_eventaction
+(SDL_ADDEVENT,
+    SDL_PEEKEVENT,
+    SDL_GETEVENT) = range(3)
+
+#From SDL_joystick.h (inserted manually)
+SDL_HAT_RIGHTUP = SDL_HAT_RIGHT | SDL_HAT_UP
+SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN
+SDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP
+SDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN
+
+# From SDL_video.h (inserted manually)
+# enum SDL_GLattr
+(SDL_GL_RED_SIZE,
+    SDL_GL_GREEN_SIZE,
+    SDL_GL_BLUE_SIZE,
+    SDL_GL_ALPHA_SIZE,
+    SDL_GL_BUFFER_SIZE,
+    SDL_GL_DOUBLEBUFFER,
+    SDL_GL_DEPTH_SIZE,
+    SDL_GL_STENCIL_SIZE,
+    SDL_GL_ACCUM_RED_SIZE,
+    SDL_GL_ACCUM_GREEN_SIZE,
+    SDL_GL_ACCUM_BLUE_SIZE,
+    SDL_GL_ACCUM_ALPHA_SIZE,
+    SDL_GL_STEREO,
+    SDL_GL_MULTISAMPLEBUFFERS,
+    SDL_GL_MULTISAMPLESAMPLES,
+    SDL_GL_ACCELERATED_VISUAL,
+    SDL_GL_SWAP_CONTROL) = range(17)
+
+# enum SDL_GrabMode
+(SDL_GRAB_QUERY,
+    SDL_GRAB_OFF,
+    SDL_GRAB_ON) = range(-1,2)
+
 # From SDL_ttf.h (inserted manually)
 TTF_STYLE_NORMAL    = 0x00
 TTF_STYLE_BOLD      = 0x01
     MIX_DEFAULT_FORMAT  = AUDIO_S16LSB 
 else:
     MIX_DEFAULT_FORMAT  = AUDIO_S16MSB
+
+# enum Mix_Fading
+(MIX_NO_FADING,
+    MIX_FADING_OUT,
+    MIX_FADING_IN) = range(3)
+
+# enum Mix_MusicType
+(MUS_NONE,
+    MUS_CMD,
+    MUS_WAV,
+    MUS_MOD,
+    MUS_MID,
+    MUS_OGG,
+    MUS_MP3) = range(7)
+
+# From SDL_sound.h (inserted manually):
+# enum Sound_SampleFlags
+SOUND_SAMPLEFLAG_NONE       = 0
+SOUND_SAMPLEFLAG_CANSEEK    = 1
+SOUND_SAMPLEFLAG_EOF        = 1 << 29
+SOUND_SAMPLEFLAG_ERROR      = 1 << 30
+SOUND_SAMPLEFLAG_EGAIN      = 1 << 31