Commits

Leonard Ritter  committed c81c19d

updated bindings

  • Participants
  • Parent commits 1ac482d

Comments (0)

Files changed (5)

File predefs/sdl.pypredef

 def SDL_GetKeyboardFocus(*argv):
     """SDL_GetKeyboardFocus"""
 
+SDL_WINDOWPOS_CENTERED = int
 SDLK_SLEEP = int
 SDLK_KP_CLEARENTRY = int
 SDL_ICONV_EILSEQ = long
     """SDL_GetSurfaceColorMod"""
 
 SDLK_KP_DECIMAL = int
-SDLK_AT = int
+SDLK_PERIOD = int
 def SDL_CreateWindowFrom(*argv):
     """SDL_CreateWindowFrom"""
 
     """SDL_PumpEvents"""
 
 SDL_SCANCODE_UP = int
-SDLK_PERIOD = int
+SDLK_AT = int
 SDL_SCANCODE_KP_MINUS = int
 def SDL_AllocFormat(*argv):
     """SDL_AllocFormat"""
 def SDL_QuitSubSystem(*argv):
     """SDL_QuitSubSystem"""
 
+SDL_WINDOWPOS_UNDEFINED = int
 SDL_SYSTEM_CURSOR_CROSSHAIR = int
 def SDL_VideoInit(*argv):
     """SDL_VideoInit"""

File sdl/__init__.py

     #SDL_free(text)
     return result
 
+def SDL_JoystickName(joystick):
+    name = _SDL_JoystickName(joystick)
+    if name == _ffi.NULL:
+        return None
+    return _ffi.string(name)
+
 ################################################################################
 
 # add wrapped functions
 "_SDL_GetClipboardText",
 "_SDL_GetDesktopDisplayMode",
 "_SDL_GL_GetAttribute",
+"_SDL_JoystickName",
 "_SDL_Init",
 "_SDL_PollEvent",
 "_SDL_GetWindowSize",
 "SDL_WINDOW_RESIZABLE",
 "SDLK_EJECT",
 "SDL_GetKeyboardFocus",
+"SDL_WINDOWPOS_CENTERED",
 "SDLK_SLEEP",
 "SDLK_KP_CLEARENTRY",
 "SDL_ICONV_EILSEQ",
 "SDL_GetWindowMaximumSize",
 "SDL_GetSurfaceColorMod",
 "SDLK_KP_DECIMAL",
-"SDLK_AT",
+"SDLK_PERIOD",
 "SDL_CreateWindowFrom",
 "SDLK_LGUI",
 "SDL_WINDOW_HIDDEN",
 "SDL_SYSTEM_CURSOR_SIZENS",
 "SDL_PumpEvents",
 "SDL_SCANCODE_UP",
-"SDLK_PERIOD",
+"SDLK_AT",
 "SDL_SCANCODE_KP_MINUS",
 "SDL_AllocFormat",
 "SDL_SYSTEM_CURSOR_NO",
 "SDL_ICONV_EINVAL",
 "SDL_TOUCHBUTTONDOWN",
 "SDL_QuitSubSystem",
+"SDL_WINDOWPOS_UNDEFINED",
 "SDL_SYSTEM_CURSOR_CROSSHAIR",
 "SDL_VideoInit",
 "SDL_SCANCODE_LANG5",
 "SDL_RaiseWindow",
 "RW_SEEK_END",
 "SDL_WINDOWEVENT_RESIZED",
-"SDL_JoystickName",
 "SDL_GetSurfaceAlphaMod",
 "SDLK_AC_REFRESH",
 "SDL_strtoll",
 SDL_WINDOW_FOREIGN = 0x00000800
 } SDL_WindowFlags;
 #define SDL_WINDOWPOS_UNDEFINED_MASK ...
+#define SDL_WINDOWPOS_UNDEFINED ...
 #define SDL_WINDOWPOS_CENTERED_MASK ...
+#define SDL_WINDOWPOS_CENTERED ...
 typedef enum
 {
 SDL_WINDOWEVENT_NONE,
 SDL_WINDOW_RESIZABLE = 32
 SDLK_EJECT = 1073742105
 SDL_GetKeyboardFocus = guard(lookup('SDL_GetKeyboardFocus'))
+SDL_WINDOWPOS_CENTERED = 805240832
 SDLK_SLEEP = 1073742106
 SDLK_KP_CLEARENTRY = 1073742041
 SDL_ICONV_EILSEQ = 18446744073709551613
 SDL_GetWindowMaximumSize = guard(lookup('SDL_GetWindowMaximumSize'))
 SDL_GetSurfaceColorMod = guard(lookup('SDL_GetSurfaceColorMod'))
 SDLK_KP_DECIMAL = 1073742044
-SDLK_AT = 64
+SDLK_PERIOD = 46
 SDL_CreateWindowFrom = guard(lookup('SDL_CreateWindowFrom'))
 SDLK_LGUI = 1073742051
 SDL_WINDOW_HIDDEN = 8
 SDL_SYSTEM_CURSOR_SIZENS = 8
 SDL_PumpEvents = guard(lookup('SDL_PumpEvents'))
 SDL_SCANCODE_UP = 82
-SDLK_PERIOD = 46
+SDLK_AT = 64
 SDL_SCANCODE_KP_MINUS = 86
 SDL_AllocFormat = guard(lookup('SDL_AllocFormat'))
 SDL_SYSTEM_CURSOR_NO = 10
 SDL_ICONV_EINVAL = 18446744073709551612
 SDL_TOUCHBUTTONDOWN = 1795
 SDL_QuitSubSystem = guard(lookup('SDL_QuitSubSystem'))
+SDL_WINDOWPOS_UNDEFINED = 536805376
 SDL_SYSTEM_CURSOR_CROSSHAIR = 3
 SDL_VideoInit = guard(lookup('SDL_VideoInit'))
 SDL_SCANCODE_LANG5 = 148
 SDL_RaiseWindow = guard(lookup('SDL_RaiseWindow'))
 RW_SEEK_END = 2
 SDL_WINDOWEVENT_RESIZED = 5
-SDL_JoystickName = guard(lookup('SDL_JoystickName'))
+_SDL_JoystickName = guard(lookup('SDL_JoystickName'))
 SDL_GetSurfaceAlphaMod = guard(lookup('SDL_GetSurfaceAlphaMod'))
 SDLK_AC_REFRESH = 1073742097
 SDL_strtoll = guard(lookup('SDL_strtoll'))

File sdl/builder.py

         'SDL_GetDesktopDisplayMode',
         'SDL_GL_GetAttribute',
         'SDL_GetClipboardText',
+        'SDL_JoystickName',
     ],
     AUTOCHECK_BLACKLIST = [
         'SDL_GetError',

File sdl_defs/SDL_video.h

  *  \brief Used to indicate that you don't care what the window position is.
  */
 #define SDL_WINDOWPOS_UNDEFINED_MASK    0x1FFF0000
+#define SDL_WINDOWPOS_UNDEFINED         SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
 
 /**
  *  \brief Used to indicate that the window position should be centered.
  */
 #define SDL_WINDOWPOS_CENTERED_MASK    0x2FFF0000
+#define SDL_WINDOWPOS_CENTERED         SDL_WINDOWPOS_CENTERED_DISPLAY(0)
 
 /**
  *  \brief Event subtype for window events