diff pytouhou/lib/_sdl.pxd @ 455:6864a38b2413

Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 02 Sep 2013 22:16:38 +0200
parents pytouhou/lib/sdl.pxd@2a352118c55a
children cae1ae9de430
line wrap: on
line diff
copy from pytouhou/lib/sdl.pxd
copy to pytouhou/lib/_sdl.pxd
--- a/pytouhou/lib/sdl.pxd
+++ b/pytouhou/lib/_sdl.pxd
@@ -12,7 +12,7 @@
 ## GNU General Public License for more details.
 ##
 
-cdef extern from "SDL.h":
+cdef extern from "SDL.h" nogil:
     ctypedef unsigned int Uint32
     ctypedef unsigned short Uint16
     ctypedef unsigned char Uint8
@@ -24,15 +24,15 @@ cdef extern from "SDL.h":
 
 
 IF UNAME_SYSNAME == "Windows":
-    cdef extern from "SDL_main.h":
+    cdef extern from "SDL_main.h" nogil:
         void SDL_SetMainReady()
 
 
-cdef extern from "SDL_error.h":
+cdef extern from "SDL_error.h" nogil:
     const char *SDL_GetError()
 
 
-cdef extern from "SDL_video.h":
+cdef extern from "SDL_video.h" nogil:
     ctypedef enum SDL_GLattr:
         SDL_GL_CONTEXT_MAJOR_VERSION
         SDL_GL_CONTEXT_MINOR_VERSION
@@ -59,7 +59,7 @@ cdef extern from "SDL_video.h":
     void SDL_SetWindowSize(SDL_Window *window, int w, int h)
 
 
-cdef extern from "SDL_scancode.h":
+cdef extern from "SDL_scancode.h" nogil:
     ctypedef enum SDL_Scancode:
         SDL_SCANCODE_Z
         SDL_SCANCODE_X
@@ -72,7 +72,7 @@ cdef extern from "SDL_scancode.h":
         SDL_SCANCODE_ESCAPE
 
 
-cdef extern from "SDL_events.h":
+cdef extern from "SDL_events.h" nogil:
     ctypedef enum SDL_EventType:
         SDL_KEYDOWN
         SDL_QUIT
@@ -91,22 +91,22 @@ cdef extern from "SDL_events.h":
     int SDL_PollEvent(SDL_Event *event)
 
 
-cdef extern from "SDL_keyboard.h":
+cdef extern from "SDL_keyboard.h" nogil:
     const Uint8 *SDL_GetKeyboardState(int *numkeys)
 
 
-cdef extern from "SDL_timer.h":
+cdef extern from "SDL_timer.h" nogil:
     Uint32 SDL_GetTicks()
     void SDL_Delay(Uint32 ms)
 
 
-cdef extern from "SDL_rect.h":
+cdef extern from "SDL_rect.h" nogil:
     ctypedef struct SDL_Rect:
         int x, y
         int w, h
 
 
-cdef extern from "SDL_surface.h":
+cdef extern from "SDL_surface.h" nogil:
     ctypedef struct SDL_Surface:
         int w, h
         unsigned char *pixels
@@ -116,7 +116,7 @@ cdef extern from "SDL_surface.h":
     SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
 
 
-cdef extern from "SDL_rwops.h":
+cdef extern from "SDL_rwops.h" nogil:
     ctypedef struct SDL_RWops:
         pass
 
@@ -124,7 +124,7 @@ cdef extern from "SDL_rwops.h":
     int SDL_RWclose(SDL_RWops *context)
 
 
-cdef extern from "SDL_image.h":
+cdef extern from "SDL_image.h" nogil:
     int IMG_INIT_PNG
 
     int IMG_Init(int flags)
@@ -132,7 +132,7 @@ cdef extern from "SDL_image.h":
     SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
 
 
-cdef extern from "SDL_mixer.h":
+cdef extern from "SDL_mixer.h" nogil:
     ctypedef enum:
         MIX_DEFAULT_FORMAT